{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:01:30.985417Z",
     "start_time": "2020-03-01T03:01:30.980258Z"
    }
   },
   "outputs": [],
   "source": [
    "import torch\n",
    "import numpy as np\n",
    "import os\n",
    "import zipfile\n",
    "\n",
    "# root_path = './../datasets'\n",
    "# processed_folder =  os.path.join(root_path)\n",
    "\n",
    "# zip_ref = zipfile.ZipFile(os.path.join(root_path,'omniglot.zip'), 'r')\n",
    "# zip_ref.extractall(root_path)\n",
    "# zip_ref.close()\n",
    "\n",
    "root_dir = './../datasets/omniglot/python'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:01:32.192415Z",
     "start_time": "2020-03-01T03:01:32.186466Z"
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "## 数据预处理\n",
    "\n",
    "# import torchvision.transforms as transforms\n",
    "# from PIL import Image\n",
    "\n",
    "# '''\n",
    "# an example of img_items:\n",
    "# ( '0709_17.png',\n",
    "#   'Alphabet_of_the_Magi/character01',\n",
    "#   './../datasets/omniglot/python/images_background/Alphabet_of_the_Magi/character01')\n",
    "# '''\n",
    "# def find_classes(root_dir):\n",
    "#     img_items = []\n",
    "#     for (root, dirs, files) in os.walk(root_dir): \n",
    "#         for file in files:\n",
    "#             if (file.endswith(\"png\")):\n",
    "#                 r = root.split('/')\n",
    "#                 img_items.append((file, r[-2] + \"/\" + r[-1], root))\n",
    "#     print(\"== Found %d items \" % len(img_items))\n",
    "#     return img_items\n",
    "\n",
    "# ## 构建一个词典{class:idx}\n",
    "# def index_classes(items):\n",
    "#     class_idx = {}\n",
    "#     count = 0\n",
    "#     for item in items:\n",
    "#         if item[1] not in class_idx:\n",
    "#             class_idx[item[1]] = count\n",
    "#             count += 1\n",
    "#     print('== Found {} classes'.format(len(class_idx)))\n",
    "#     return class_idx\n",
    "        \n",
    "\n",
    "# img_items =  find_classes(root_dir)\n",
    "# class_idx = index_classes(img_items)\n",
    "\n",
    "\n",
    "# temp = dict()\n",
    "# for imgname, classes, dirs in img_items:\n",
    "#     img = '{}/{}'.format(dirs, imgname)\n",
    "#     label = class_idx[classes]\n",
    "#     transform = transforms.Compose([lambda img: Image.open(img).convert('L'),\n",
    "#                               lambda img: img.resize((28,28)),\n",
    "#                               lambda img: np.reshape(img, (28,28,1)),\n",
    "#                               lambda img: np.transpose(img, [2,0,1]),\n",
    "#                               lambda img: img/255.\n",
    "#                               ])\n",
    "#     img = transform(img)\n",
    "#     if label in temp.keys():\n",
    "#         temp[label].append(img)\n",
    "#     else:\n",
    "#         temp[label] = [img]\n",
    "# print('begin to generate omniglot.npy')\n",
    "# ## 移除标签信息，每个标签包含20个样本\n",
    "# img_list = []\n",
    "# for label, imgs in temp.items():\n",
    "#     img_list.append(np.array(imgs))\n",
    "# img_list = np.array(img_list).astype(np.float) # [[20 imgs],..., 1623 classes in total]\n",
    "# print('data shape:{}'.format(img_list.shape)) # (1623, 20, 1, 28, 28)\n",
    "# temp = []\n",
    "# np.save(os.path.join(root_dir, 'omniglot.npy'), img_list)\n",
    "# print('end.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-02-26T10:57:28.625609Z",
     "start_time": "2020-02-26T10:57:26.891607Z"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:01:35.136101Z",
     "start_time": "2020-03-01T03:01:33.276201Z"
    }
   },
   "outputs": [],
   "source": [
    "img_list = np.load(os.path.join(root_dir, 'omniglot.npy')) # (1623, 20, 1, 28, 28)\n",
    "x_train = img_list[:1200]\n",
    "x_test = img_list[1200:]\n",
    "num_classes = img_list.shape[0]\n",
    "datasets = {'train': x_train, 'test': x_test}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:01:37.086515Z",
     "start_time": "2020-03-01T03:01:36.882758Z"
    },
    "code_folding": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DB: train (1200, 20, 1, 28, 28) test (423, 20, 1, 28, 28)\n"
     ]
    }
   ],
   "source": [
    "### 准备数据迭代器\n",
    "n_way = 5\n",
    "k_spt = 1  ## support data 的个数\n",
    "k_query = 15 ## query data 的个数\n",
    "imgsz = 28\n",
    "resize = imgsz\n",
    "task_num = 8\n",
    "batch_size = task_num\n",
    "\n",
    "indexes = {\"train\": 0, \"test\": 0}\n",
    "datasets = {\"train\": x_train, \"test\": x_test}\n",
    "print(\"DB: train\", x_train.shape, \"test\", x_test.shape)\n",
    "\n",
    "\n",
    "def load_data_cache(dataset):\n",
    "    \"\"\"\n",
    "    Collects several batches data for N-shot learning\n",
    "    :param dataset: [cls_num, 20, 84, 84, 1]\n",
    "    :return: A list with [support_set_x, support_set_y, target_x, target_y] ready to be fed to our networks\n",
    "    \"\"\"\n",
    "    #  take 5 way 1 shot as example: 5 * 1\n",
    "    setsz = k_spt * n_way\n",
    "    querysz = k_query * n_way\n",
    "    data_cache = []\n",
    "\n",
    "    # print('preload next 10 caches of batch_size of batch.')\n",
    "    for sample in range(10):  # num of epochs\n",
    "\n",
    "        x_spts, y_spts, x_qrys, y_qrys = [], [], [], []\n",
    "        for i in range(batch_size):  # one batch means one set\n",
    "\n",
    "            x_spt, y_spt, x_qry, y_qry = [], [], [], []\n",
    "            selected_cls = np.random.choice(dataset.shape[0], n_way, replace =  False) \n",
    "\n",
    "            for j, cur_class in enumerate(selected_cls):\n",
    "\n",
    "                selected_img = np.random.choice(20, k_spt + k_query, replace = False)\n",
    "\n",
    "                # 构造support集和query集\n",
    "                x_spt.append(dataset[cur_class][selected_img[:k_spt]])\n",
    "                x_qry.append(dataset[cur_class][selected_img[k_spt:]])\n",
    "                y_spt.append([j for _ in range(k_spt)])\n",
    "                y_qry.append([j for _ in range(k_query)])\n",
    "\n",
    "            # shuffle inside a batch\n",
    "            perm = np.random.permutation(n_way * k_spt)\n",
    "            x_spt = np.array(x_spt).reshape(n_way * k_spt, 1, resize, resize)[perm]\n",
    "            y_spt = np.array(y_spt).reshape(n_way * k_spt)[perm]\n",
    "            perm = np.random.permutation(n_way * k_query)\n",
    "            x_qry = np.array(x_qry).reshape(n_way * k_query, 1, resize, resize)[perm]\n",
    "            y_qry = np.array(y_qry).reshape(n_way * k_query)[perm]\n",
    " \n",
    "            # append [sptsz, 1, 84, 84] => [batch_size, setsz, 1, 84, 84]\n",
    "            x_spts.append(x_spt)\n",
    "            y_spts.append(y_spt)\n",
    "            x_qrys.append(x_qry)\n",
    "            y_qrys.append(y_qry)\n",
    "\n",
    "#         print(x_spts[0].shape)\n",
    "        # [b, setsz = n_way * k_spt, 1, 84, 84]\n",
    "        x_spts = np.array(x_spts).astype(np.float32).reshape(batch_size, setsz, 1, resize, resize)\n",
    "        y_spts = np.array(y_spts).astype(np.int).reshape(batch_size, setsz)\n",
    "        # [b, qrysz = n_way * k_query, 1, 84, 84]\n",
    "        x_qrys = np.array(x_qrys).astype(np.float32).reshape(batch_size, querysz, 1, resize, resize)\n",
    "        y_qrys = np.array(y_qrys).astype(np.int).reshape(batch_size, querysz)\n",
    "#         print(x_qrys.shape)\n",
    "        data_cache.append([x_spts, y_spts, x_qrys, y_qrys])\n",
    "\n",
    "    return data_cache\n",
    "\n",
    "datasets_cache = {\"train\": load_data_cache(x_train),  # current epoch data cached\n",
    "                       \"test\": load_data_cache(x_test)}\n",
    "\n",
    "def next(mode='train'):\n",
    "    \"\"\"\n",
    "    Gets next batch from the dataset with name.\n",
    "    :param mode: The name of the splitting (one of \"train\", \"val\", \"test\")\n",
    "    :return:\n",
    "    \"\"\"\n",
    "    # update cache if indexes is larger than len(data_cache)\n",
    "    if indexes[mode] >= len(datasets_cache[mode]):\n",
    "        indexes[mode] = 0\n",
    "        datasets_cache[mode] = load_data_cache(datasets[mode])\n",
    "\n",
    "    next_batch = datasets_cache[mode][indexes[mode]]\n",
    "    indexes[mode] += 1\n",
    "\n",
    "    return next_batch\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:01:39.652080Z",
     "start_time": "2020-03-01T03:01:39.618363Z"
    },
    "code_folding": []
   },
   "outputs": [],
   "source": [
    "import torch\n",
    "from torch import nn\n",
    "from torch.nn import functional as F\n",
    "from copy import deepcopy,copy\n",
    "        \n",
    "\n",
    "class BaseNet(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(BaseNet, self).__init__()\n",
    "        self.vars = nn.ParameterList()  ## 包含了所有需要被优化的tensor\n",
    "        self.vars_bn = nn.ParameterList()\n",
    "        \n",
    "        # 第1个conv2d\n",
    "        # in_channels = 1, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2\n",
    "        weight = nn.Parameter(torch.ones(64, 1, 3, 3))\n",
    "        nn.init.kaiming_normal_(weight)\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        # 第1个BatchNorm层\n",
    "        weight = nn.Parameter(torch.ones(64))\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        running_mean = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        running_var = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        self.vars_bn.extend([running_mean, running_var])\n",
    "        \n",
    "        # 第2个conv2d\n",
    "        # in_channels = 1, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2\n",
    "        weight = nn.Parameter(torch.ones(64, 64, 3, 3))\n",
    "        nn.init.kaiming_normal_(weight)\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        # 第2个BatchNorm层\n",
    "        weight = nn.Parameter(torch.ones(64))\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        running_mean = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        running_var = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        self.vars_bn.extend([running_mean, running_var])\n",
    "        \n",
    "        # 第3个conv2d\n",
    "        # in_channels = 1, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2\n",
    "        weight = nn.Parameter(torch.ones(64, 64, 3, 3))\n",
    "        nn.init.kaiming_normal_(weight)\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        # 第3个BatchNorm层\n",
    "        weight = nn.Parameter(torch.ones(64))\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        running_mean = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        running_var = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        self.vars_bn.extend([running_mean, running_var])\n",
    "        \n",
    "        # 第4个conv2d\n",
    "        # in_channels = 1, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2\n",
    "        weight = nn.Parameter(torch.ones(64, 64, 3, 3))\n",
    "        nn.init.kaiming_normal_(weight)\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        # 第4个BatchNorm层\n",
    "        weight = nn.Parameter(torch.ones(64))\n",
    "        bias = nn.Parameter(torch.zeros(64))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "        running_mean = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        running_var = nn.Parameter(torch.zeros(64), requires_grad= False)\n",
    "        self.vars_bn.extend([running_mean, running_var])\n",
    "        \n",
    "        ##linear\n",
    "        weight = nn.Parameter(torch.ones([5,64]))\n",
    "        bias = nn.Parameter(torch.zeros(5))\n",
    "        self.vars.extend([weight,bias])\n",
    "        \n",
    "#         self.conv = nn.Sequential(\n",
    "#             nn.Conv2d(in_channels = 1, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2),\n",
    "#             nn.BatchNorm2d(64),\n",
    "#             nn.ReLU(),\n",
    "#             nn.MaxPool2d(2),\n",
    "            \n",
    "#             nn.Conv2d(in_channels = 64, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2),\n",
    "#             nn.BatchNorm2d(64),\n",
    "#             nn.ReLU(),\n",
    "#             nn.MaxPool2d(2),\n",
    "            \n",
    "#             nn.Conv2d(in_channels = 64, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2),\n",
    "#             nn.BatchNorm2d(64),\n",
    "#             nn.ReLU(),\n",
    "#             nn.MaxPool2d(2), \n",
    "            \n",
    "#             nn.Conv2d(in_channels = 64, out_channels = 64, kernel_size = (3,3), padding = 2, stride = 2),\n",
    "#             nn.BatchNorm2d(64),\n",
    "#             nn.ReLU(),\n",
    "#             nn.MaxPool2d(2), \n",
    "            \n",
    "#             FlattenLayer(),\n",
    "#             nn.Linear(64,5)\n",
    "#         )        \n",
    " \n",
    "        \n",
    "    def forward(self, x, params = None, bn_training=True):\n",
    "        '''\n",
    "        :bn_training: set False to not update\n",
    "        :return: \n",
    "        '''\n",
    "        if params is None:\n",
    "            params = self.vars\n",
    "        \n",
    "        weight, bias = params[0], params[1]  # 第1个CONV层\n",
    "        x = F.conv2d(x, weight, bias, stride = 2, padding = 2)\n",
    "        \n",
    "        weight, bias = params[2], params[3]  # 第1个BN层\n",
    "        running_mean, running_var = self.vars_bn[0], self.vars_bn[1]\n",
    "        x = F.batch_norm(x, running_mean, running_var, weight=weight,bias =bias, training= bn_training)\n",
    "        x = F.max_pool2d(x,kernel_size=2)  #第1个MAX_POOL层  \n",
    "        x = F.relu(x, inplace = [True])  #第1个relu\n",
    "        \n",
    "        \n",
    "        weight, bias = params[4], params[5]  # 第2个CONV层\n",
    "        x = F.conv2d(x, weight, bias, stride = 2, padding = 2)\n",
    "        \n",
    "        weight, bias = params[6], params[7]  # 第2个BN层\n",
    "        running_mean, running_var = self.vars_bn[2], self.vars_bn[3]\n",
    "        x = F.batch_norm(x, running_mean, running_var, weight=weight,bias =bias, training= bn_training)\n",
    "        x = F.max_pool2d(x,kernel_size=2)  #第2个MAX_POOL层   \n",
    "        x = F.relu(x, inplace = [True])  #第2个relu\n",
    "        \n",
    "        weight, bias = params[8], params[9]  # 第3个CONV层\n",
    "        x = F.conv2d(x, weight, bias, stride = 2, padding = 2)\n",
    "        \n",
    "        weight, bias = params[10], params[11]  # 第3个BN层\n",
    "        running_mean, running_var = self.vars_bn[4], self.vars_bn[5]\n",
    "        x = F.batch_norm(x, running_mean, running_var, weight=weight,bias =bias, training= bn_training)\n",
    "        x = F.max_pool2d(x,kernel_size=2)  #第3个MAX_POOL层\n",
    "        x = F.relu(x, inplace = [True])  #第3个relu\n",
    "        \n",
    "        weight, bias = params[12], params[13]  # 第4个CONV层\n",
    "        x = F.conv2d(x, weight, bias, stride = 2, padding = 2)\n",
    "        x = F.relu(x, inplace = [True])  #第4个relu\n",
    "        weight, bias = params[14], params[15]  # 第4个BN层\n",
    "        running_mean, running_var = self.vars_bn[6], self.vars_bn[7]\n",
    "        x = F.batch_norm(x, running_mean, running_var, weight=weight,bias =bias, training= bn_training)\n",
    "        x = F.max_pool2d(x,kernel_size=2)  #第4个MAX_POOL层\n",
    "        \n",
    "        \n",
    "        x = x.view(x.size(0), -1) ## flatten\n",
    "        weight, bias = params[16], params[17]  # linear\n",
    "        x = F.linear(x, weight, bias)\n",
    "        \n",
    "        output = x\n",
    "        \n",
    "        return output\n",
    "    \n",
    "    \n",
    "    def parameters(self):\n",
    "        \n",
    "        return self.vars\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-02-29T12:00:30.197710Z",
     "start_time": "2020-02-29T12:00:30.186076Z"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-02-29T05:41:40.773998Z",
     "start_time": "2020-02-29T05:41:40.762077Z"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T06:38:32.947417Z",
     "start_time": "2020-03-01T06:38:32.918955Z"
    },
    "code_folding": []
   },
   "outputs": [],
   "source": [
    "class MetaLearner(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(MetaLearner, self).__init__()\n",
    "        self.update_step = 5 ## task-level inner update steps\n",
    "        self.update_step_test = 5  \n",
    "        self.net = BaseNet()\n",
    "        self.meta_lr = 2e-4\n",
    "        self.base_lr = 4 * 1e-2\n",
    "        self.inner_lr = 0.4\n",
    "        self.outer_lr = 1e-2\n",
    "        self.meta_optim = torch.optim.Adam(self.net.parameters(), lr = self.meta_lr)\n",
    "        \n",
    "    def forward(self,x_spt, y_spt, x_qry, y_qry):\n",
    "        # 初始化\n",
    "        task_num, ways, shots, h, w = x_spt.size()\n",
    "        query_size = x_qry.size(1) # 75 = 15 * 5\n",
    "        loss_list_qry = [0 for _ in range(self.update_step + 1)]\n",
    "        correct_list = [0 for _ in range(self.update_step + 1)]\n",
    "        \n",
    "        for i in range(task_num):\n",
    "            ## 第0步更新\n",
    "            y_hat = self.net(x_spt[i], params = None, bn_training=True) # (ways * shots, ways)\n",
    "            loss = F.cross_entropy(y_hat, y_spt[i]) \n",
    "            grad = torch.autograd.grad(loss, self.net.parameters())\n",
    "            tuples = zip(grad, self.net.parameters()) ## 将梯度和参数\\theta一一对应起来\n",
    "            # fast_weights这一步相当于求了一个\\theta - \\alpha*\\nabla(L)\n",
    "            fast_weights = list(map(lambda p: p[1] - self.base_lr * p[0], tuples))\n",
    "            # 在query集上测试，计算准确率\n",
    "            # 这一步使用更新前的数据\n",
    "            with torch.no_grad():\n",
    "                y_hat = self.net(x_qry[i], self.net.parameters(), bn_training = True)\n",
    "                loss_qry = F.cross_entropy(y_hat, y_qry[i])\n",
    "                loss_list_qry[0] += loss_qry\n",
    "                pred_qry = F.softmax(y_hat, dim=1).argmax(dim=1)  # size = (75)\n",
    "                correct = torch.eq(pred_qry, y_qry[i]).sum().item()\n",
    "                correct_list[0] += correct\n",
    "            \n",
    "            # 使用更新后的数据在query集上测试。\n",
    "            with torch.no_grad():\n",
    "                y_hat = self.net(x_qry[i], fast_weights, bn_training = True)\n",
    "                loss_qry = F.cross_entropy(y_hat, y_qry[i])\n",
    "                loss_list_qry[1] += loss_qry\n",
    "                pred_qry = F.softmax(y_hat, dim=1).argmax(dim=1)  # size = (75)\n",
    "                correct = torch.eq(pred_qry, y_qry[i]).sum().item()\n",
    "                correct_list[1] += correct   \n",
    "            \n",
    "            for k in range(1, self.update_step):\n",
    "                \n",
    "                y_hat = self.net(x_spt[i], params = fast_weights, bn_training=True)\n",
    "                loss = F.cross_entropy(y_hat, y_spt[i])\n",
    "                grad = torch.autograd.grad(loss, fast_weights)\n",
    "                tuples = zip(grad, fast_weights) \n",
    "                fast_weights = list(map(lambda p: p[1] - self.base_lr * p[0], tuples))\n",
    "                    \n",
    "                y_hat = self.net(x_qry[i], params = fast_weights, bn_training = True)\n",
    "                loss_qry = F.cross_entropy(y_hat, y_qry[i])\n",
    "                loss_list_qry[k+1] += loss_qry\n",
    "                \n",
    "                with torch.no_grad():\n",
    "                    pred_qry = F.softmax(y_hat,dim=1).argmax(dim=1)\n",
    "                    correct = torch.eq(pred_qry, y_qry[i]).sum().item()\n",
    "                    correct_list[k+1] += correct\n",
    "#         print('hello')\n",
    "                \n",
    "        loss_qry = loss_list_qry[-1] / task_num\n",
    "        self.meta_optim.zero_grad() # 梯度清零\n",
    "        loss_qry.backward()\n",
    "        self.meta_optim.step()\n",
    "        \n",
    "        accs = np.array(correct_list) / (query_size * task_num)\n",
    "        loss = np.array(loss_list_qry) / ( task_num)\n",
    "        return accs,loss\n",
    "\n",
    "    \n",
    "    \n",
    "    def finetunning(self, x_spt, y_spt, x_qry, y_qry):\n",
    "        assert len(x_spt.shape) == 4\n",
    "        \n",
    "        query_size = x_qry.size(0)\n",
    "        correct_list = [0 for _ in range(self.update_step_test + 1)]\n",
    "        \n",
    "        new_net = deepcopy(self.net)\n",
    "        y_hat = new_net(x_spt)\n",
    "        loss = F.cross_entropy(y_hat, y_spt)\n",
    "        grad = torch.autograd.grad(loss, new_net.parameters())\n",
    "        fast_weights = list(map(lambda p:p[1] - self.base_lr * p[0], zip(grad, new_net.parameters())))\n",
    "        \n",
    "        # 在query集上测试，计算准确率\n",
    "        # 这一步使用更新前的数据\n",
    "        with torch.no_grad():\n",
    "            y_hat = new_net(x_qry,  params = new_net.parameters(), bn_training = True)\n",
    "            pred_qry = F.softmax(y_hat, dim=1).argmax(dim=1)  # size = (75)\n",
    "            correct = torch.eq(pred_qry, y_qry).sum().item()\n",
    "            correct_list[0] += correct\n",
    "\n",
    "        # 使用更新后的数据在query集上测试。\n",
    "        with torch.no_grad():\n",
    "            y_hat = new_net(x_qry, params = fast_weights, bn_training = True)\n",
    "            pred_qry = F.softmax(y_hat, dim=1).argmax(dim=1)  # size = (75)\n",
    "            correct = torch.eq(pred_qry, y_qry).sum().item()\n",
    "            correct_list[1] += correct\n",
    "\n",
    "        for k in range(1, self.update_step_test):\n",
    "            y_hat = new_net(x_spt, params = fast_weights, bn_training=True)\n",
    "            loss = F.cross_entropy(y_hat, y_spt)\n",
    "            grad = torch.autograd.grad(loss, fast_weights)\n",
    "            fast_weights = list(map(lambda p:p[1] - self.base_lr * p[0], zip(grad, fast_weights)))\n",
    "            \n",
    "            y_hat = new_net(x_qry, fast_weights, bn_training=True)\n",
    "            \n",
    "            with torch.no_grad():\n",
    "                pred_qry = F.softmax(y_hat, dim=1).argmax(dim=1)\n",
    "                correct = torch.eq(pred_qry, y_qry).sum().item()\n",
    "                correct_list[k+1] += correct\n",
    "                \n",
    "        del new_net\n",
    "        accs = np.array(correct_list) / query_size\n",
    "        return accs\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T06:38:33.660821Z",
     "start_time": "2020-03-01T06:38:33.657697Z"
    }
   },
   "outputs": [],
   "source": [
    "# net = torch.load('./trained_models/MTL-5000epochs.pt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T11:01:02.729067Z",
     "start_time": "2020-03-01T06:38:34.192953Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 0\n",
      "[0.2        0.29333333 0.375      0.41333333 0.43       0.43666667]\n",
      "[tensor(1.6094, device='cuda:0') tensor(1.5602, device='cuda:0')\n",
      " tensor(1.5179, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.4858, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.4404, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.4106, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2009 0.2825 0.3257 0.3396 0.3528 0.36  ]\n",
      "epoch: 100\n",
      "[0.2        0.515      0.55666667 0.59166667 0.605      0.6       ]\n",
      "[tensor(1.6131, device='cuda:0') tensor(1.3106, device='cuda:0')\n",
      " tensor(1.1762, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.1033, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.0616, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(1.0450, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 200\n",
      "[0.29166667 0.53833333 0.61333333 0.62833333 0.63833333 0.645     ]\n",
      "[tensor(1.5989, device='cuda:0') tensor(1.1745, device='cuda:0')\n",
      " tensor(1.0416, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.9874, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.9640, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.9548, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 300\n",
      "[0.15       0.57833333 0.65666667 0.675      0.675      0.68      ]\n",
      "[tensor(1.6094, device='cuda:0') tensor(1.1255, device='cuda:0')\n",
      " tensor(0.9720, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.9047, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.8730, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.8553, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 400\n",
      "[0.21666667 0.67       0.73       0.72666667 0.725      0.71833333]\n",
      "[tensor(1.6099, device='cuda:0') tensor(1.0556, device='cuda:0')\n",
      " tensor(0.8824, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.8076, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7721, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7524, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 500\n",
      "[0.21166667 0.66166667 0.75333333 0.75666667 0.755      0.76166667]\n",
      "[tensor(1.6170, device='cuda:0') tensor(1.0633, device='cuda:0')\n",
      " tensor(0.8834, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.8054, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7673, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7285, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 600\n",
      "[0.21333333 0.68833333 0.74166667 0.74       0.745      0.745     ]\n",
      "[tensor(1.6069, device='cuda:0') tensor(1.0424, device='cuda:0')\n",
      " tensor(0.8623, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7916, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7547, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7344, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 700\n",
      "[0.20833333 0.75166667 0.80333333 0.81       0.81333333 0.81666667]\n",
      "[tensor(1.6062, device='cuda:0') tensor(0.9944, device='cuda:0')\n",
      " tensor(0.8057, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.7244, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6786, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6517, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 800\n",
      "[0.235      0.795      0.84333333 0.84       0.845      0.84166667]\n",
      "[tensor(1.6040, device='cuda:0') tensor(0.9110, device='cuda:0')\n",
      " tensor(0.7309, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6576, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6198, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5963, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 900\n",
      "[0.24333333 0.72833333 0.81833333 0.815      0.82333333 0.81833333]\n",
      "[tensor(1.6037, device='cuda:0') tensor(0.8989, device='cuda:0')\n",
      " tensor(0.7238, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6506, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6133, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5895, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1000\n",
      "[0.2        0.74666667 0.805      0.82166667 0.83166667 0.83666667]\n",
      "[tensor(1.6070, device='cuda:0') tensor(0.8875, device='cuda:0')\n",
      " tensor(0.7236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6062, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5800, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.202  0.6978 0.7397 0.7417 0.7417 0.7407]\n",
      "epoch: 1100\n",
      "[0.185      0.79       0.845      0.86166667 0.85833333 0.85833333]\n",
      "[tensor(1.6129, device='cuda:0') tensor(0.8425, device='cuda:0')\n",
      " tensor(0.6716, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5950, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5568, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5330, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1200\n",
      "[0.16666667 0.80166667 0.86166667 0.86666667 0.86833333 0.86666667]\n",
      "[tensor(1.6154, device='cuda:0') tensor(0.8237, device='cuda:0')\n",
      " tensor(0.6602, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5918, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5528, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5296, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1300\n",
      "[0.19166667 0.84166667 0.865      0.86833333 0.86666667 0.86666667]\n",
      "[tensor(1.6214, device='cuda:0') tensor(0.7687, device='cuda:0')\n",
      " tensor(0.6120, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5497, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5168, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4954, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1400\n",
      "[0.22666667 0.85166667 0.875      0.87166667 0.86666667 0.86833333]\n",
      "[tensor(1.6149, device='cuda:0') tensor(0.7596, device='cuda:0')\n",
      " tensor(0.6024, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5394, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5052, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4836, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1500\n",
      "[0.21666667 0.78833333 0.81333333 0.82       0.82166667 0.82166667]\n",
      "[tensor(1.6516, device='cuda:0') tensor(0.7913, device='cuda:0')\n",
      " tensor(0.6599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.6112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5854, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5693, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1600\n",
      "[0.23666667 0.81666667 0.87166667 0.87833333 0.87666667 0.87833333]\n",
      "[tensor(1.6228, device='cuda:0') tensor(0.7455, device='cuda:0')\n",
      " tensor(0.5893, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5323, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4999, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4820, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1700\n",
      "[0.23833333 0.78333333 0.845      0.85       0.855      0.855     ]\n",
      "[tensor(1.6527, device='cuda:0') tensor(0.7278, device='cuda:0')\n",
      " tensor(0.5975, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5228, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5055, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1800\n",
      "[0.19833333 0.79666667 0.85       0.85       0.84833333 0.84666667]\n",
      "[tensor(1.7178, device='cuda:0') tensor(0.7580, device='cuda:0')\n",
      " tensor(0.6275, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5784, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5532, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5368, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 1900\n",
      "[0.2        0.77333333 0.84166667 0.85166667 0.85333333 0.855     ]\n",
      "[tensor(1.8167, device='cuda:0') tensor(0.7270, device='cuda:0')\n",
      " tensor(0.5892, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5397, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5150, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4993, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2000\n",
      "[0.2        0.68666667 0.805      0.82833333 0.83       0.83333333]\n",
      "[tensor(2.5511, device='cuda:0') tensor(0.9509, device='cuda:0')\n",
      " tensor(0.6493, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5839, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5601, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5453, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.662  0.783  0.7954 0.7983 0.799 ]\n",
      "epoch: 2100\n",
      "[0.2        0.725      0.835      0.86666667 0.87333333 0.86      ]\n",
      "[tensor(3.6135, device='cuda:0') tensor(0.8994, device='cuda:0')\n",
      " tensor(0.6206, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5167, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4947, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4806, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 2200\n",
      "[0.2        0.75       0.86       0.905      0.89833333 0.89666667]\n",
      "[tensor(4.6417, device='cuda:0') tensor(0.8151, device='cuda:0')\n",
      " tensor(0.5254, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4210, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4045, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2300\n",
      "[0.2        0.85166667 0.905      0.905      0.90833333 0.90833333]\n",
      "[tensor(5.4049, device='cuda:0') tensor(0.6904, device='cuda:0')\n",
      " tensor(0.4569, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3960, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3671, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3483, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2400\n",
      "[0.2        0.81       0.85166667 0.86833333 0.87       0.87      ]\n",
      "[tensor(6.1629, device='cuda:0') tensor(0.6922, device='cuda:0')\n",
      " tensor(0.5321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4724, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4490, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4359, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2500\n",
      "[0.2        0.81166667 0.87       0.87       0.865      0.87666667]\n",
      "[tensor(6.6007, device='cuda:0') tensor(0.6557, device='cuda:0')\n",
      " tensor(0.5084, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4794, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4200, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2600\n",
      "[0.2        0.845      0.87833333 0.86833333 0.87166667 0.875     ]\n",
      "[tensor(7.1027, device='cuda:0') tensor(0.6893, device='cuda:0')\n",
      " tensor(0.5156, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4584, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4297, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4136, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2700\n",
      "[0.2        0.76666667 0.82666667 0.84       0.84       0.83833333]\n",
      "[tensor(7.6541, device='cuda:0') tensor(0.7405, device='cuda:0')\n",
      " tensor(0.5618, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5161, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4976, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4862, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2800\n",
      "[0.2        0.85833333 0.87666667 0.88666667 0.88666667 0.88666667]\n",
      "[tensor(7.8518, device='cuda:0') tensor(0.6468, device='cuda:0')\n",
      " tensor(0.4988, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4477, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4142, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 2900\n",
      "[0.2        0.825      0.87833333 0.89       0.88333333 0.88666667]\n",
      "[tensor(7.9138, device='cuda:0') tensor(0.6240, device='cuda:0')\n",
      " tensor(0.4744, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4001, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3851, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3000\n",
      "[0.2        0.77833333 0.81166667 0.82666667 0.82333333 0.83166667]\n",
      "[tensor(8.3409, device='cuda:0') tensor(0.7239, device='cuda:0')\n",
      " tensor(0.5905, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5527, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5354, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5250, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.7695 0.8115 0.8164 0.8184 0.8184]\n",
      "epoch: 3100\n",
      "[0.2        0.83333333 0.85       0.84833333 0.85666667 0.85666667]\n",
      "[tensor(8.5831, device='cuda:0') tensor(0.6342, device='cuda:0')\n",
      " tensor(0.5166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4588, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4407, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4286, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3200\n",
      "[0.2        0.84833333 0.91333333 0.92       0.92666667 0.925     ]\n",
      "[tensor(8.4257, device='cuda:0') tensor(0.5171, device='cuda:0')\n",
      " tensor(0.3758, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3307, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3027, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3300\n",
      "[0.2        0.83166667 0.92166667 0.92833333 0.93166667 0.93166667]\n",
      "[tensor(8.6517, device='cuda:0') tensor(0.5430, device='cuda:0')\n",
      " tensor(0.3883, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3485, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3253, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3117, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3400\n",
      "[0.2        0.83166667 0.89       0.89666667 0.905      0.90333333]\n",
      "[tensor(8.9651, device='cuda:0') tensor(0.5276, device='cuda:0')\n",
      " tensor(0.4165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3824, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3573, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3472, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3500\n",
      "[0.2        0.84       0.89166667 0.88666667 0.895      0.89333333]\n",
      "[tensor(9.1362, device='cuda:0') tensor(0.5392, device='cuda:0')\n",
      " tensor(0.4158, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3973, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3757, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3649, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3600\n",
      "[0.2        0.825      0.86833333 0.87166667 0.88       0.88      ]\n",
      "[tensor(9.0353, device='cuda:0') tensor(0.5644, device='cuda:0')\n",
      " tensor(0.4381, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4091, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3920, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3806, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3700\n",
      "[0.2        0.85       0.895      0.89166667 0.88833333 0.89333333]\n",
      "[tensor(9.5788, device='cuda:0') tensor(0.5314, device='cuda:0')\n",
      " tensor(0.4243, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3915, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3860, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3732, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3800\n",
      "[0.2        0.855      0.88666667 0.89333333 0.89833333 0.9       ]\n",
      "[tensor(9.6830, device='cuda:0') tensor(0.5032, device='cuda:0')\n",
      " tensor(0.4089, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3728, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3572, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3469, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 3900\n",
      "[0.2        0.825      0.81833333 0.84833333 0.84833333 0.84833333]\n",
      "[tensor(9.8982, device='cuda:0') tensor(0.5539, device='cuda:0')\n",
      " tensor(0.4974, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4544, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4422, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4346, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4000\n",
      "[0.2        0.88166667 0.89333333 0.90166667 0.90666667 0.91      ]\n",
      "[tensor(9.9468, device='cuda:0') tensor(0.4334, device='cuda:0')\n",
      " tensor(0.3643, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3425, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3335, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3274, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.7812 0.8135 0.8237 0.8267 0.8276]\n",
      "epoch: 4100\n",
      "[0.2        0.855      0.90833333 0.91       0.91666667 0.915     ]\n",
      "[tensor(10.2286, device='cuda:0') tensor(0.4379, device='cuda:0')\n",
      " tensor(0.3369, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3147, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3033, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2951, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4200\n",
      "[0.2        0.78833333 0.81333333 0.83166667 0.84333333 0.855     ]\n",
      "[tensor(10.4267, device='cuda:0') tensor(0.5183, device='cuda:0')\n",
      " tensor(0.5278, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4297, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4044, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3962, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4300\n",
      "[0.2        0.83333333 0.875      0.89166667 0.89666667 0.89333333]\n",
      "[tensor(10.2741, device='cuda:0') tensor(0.4462, device='cuda:0')\n",
      " tensor(0.3884, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3415, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3272, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 4400\n",
      "[0.2        0.88333333 0.89833333 0.895      0.89666667 0.895     ]\n",
      "[tensor(10.6987, device='cuda:0') tensor(0.4104, device='cuda:0')\n",
      " tensor(0.3662, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3445, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3399, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4500\n",
      "[0.2        0.87333333 0.88833333 0.89166667 0.91       0.91166667]\n",
      "[tensor(10.5549, device='cuda:0') tensor(0.3994, device='cuda:0')\n",
      " tensor(0.3573, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3035, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2968, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4600\n",
      "[0.2        0.84166667 0.85833333 0.865      0.87333333 0.87      ]\n",
      "[tensor(10.8610, device='cuda:0') tensor(0.4529, device='cuda:0')\n",
      " tensor(0.3946, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3796, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3731, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3687, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4700\n",
      "[0.2        0.85333333 0.89333333 0.89166667 0.89333333 0.89166667]\n",
      "[tensor(10.9752, device='cuda:0') tensor(0.4155, device='cuda:0')\n",
      " tensor(0.3380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3225, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3176, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3137, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4800\n",
      "[0.2        0.84166667 0.88833333 0.89833333 0.9        0.89666667]\n",
      "[tensor(10.9596, device='cuda:0') tensor(0.4189, device='cuda:0')\n",
      " tensor(0.3523, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3241, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3162, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3109, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 4900\n",
      "[0.2        0.89333333 0.86666667 0.89666667 0.90166667 0.90166667]\n",
      "[tensor(11.1685, device='cuda:0') tensor(0.3541, device='cuda:0')\n",
      " tensor(0.3552, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3100, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3016, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2977, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5000\n",
      "[0.2        0.92666667 0.95333333 0.95       0.95       0.95      ]\n",
      "[tensor(11.2577, device='cuda:0') tensor(0.2561, device='cuda:0')\n",
      " tensor(0.2097, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2008, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1945, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1897, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.802  0.8213 0.83   0.8335 0.835 ]\n",
      "epoch: 5100\n",
      "[0.2        0.81       0.84833333 0.86166667 0.86333333 0.86333333]\n",
      "[tensor(12.0419, device='cuda:0') tensor(0.4350, device='cuda:0')\n",
      " tensor(0.3990, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3731, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3682, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5200\n",
      "[0.2        0.89666667 0.91833333 0.92       0.92166667 0.92      ]\n",
      "[tensor(11.6157, device='cuda:0') tensor(0.3126, device='cuda:0')\n",
      " tensor(0.2692, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2543, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2465, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2409, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5300\n",
      "[0.2        0.89       0.91833333 0.91833333 0.92166667 0.92      ]\n",
      "[tensor(11.7749, device='cuda:0') tensor(0.3296, device='cuda:0')\n",
      " tensor(0.2700, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2583, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2530, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2492, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5400\n",
      "[0.2        0.90833333 0.91833333 0.91333333 0.91333333 0.91666667]\n",
      "[tensor(11.7611, device='cuda:0') tensor(0.3100, device='cuda:0')\n",
      " tensor(0.2604, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2498, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2422, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2367, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5500\n",
      "[0.2        0.925      0.92333333 0.92666667 0.92833333 0.92833333]\n",
      "[tensor(11.8433, device='cuda:0') tensor(0.2703, device='cuda:0')\n",
      " tensor(0.2437, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2261, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2210, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5600\n",
      "[0.2        0.88       0.90333333 0.89333333 0.91333333 0.91666667]\n",
      "[tensor(12.2163, device='cuda:0') tensor(0.3120, device='cuda:0')\n",
      " tensor(0.3090, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3485, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2720, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2644, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5700\n",
      "[0.2        0.91333333 0.90666667 0.91333333 0.90833333 0.91      ]\n",
      "[tensor(12.4125, device='cuda:0') tensor(0.2929, device='cuda:0')\n",
      " tensor(0.2748, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2722, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2696, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2665, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5800\n",
      "[0.2        0.86166667 0.875      0.87833333 0.88333333 0.88333333]\n",
      "[tensor(12.5103, device='cuda:0') tensor(0.4131, device='cuda:0')\n",
      " tensor(0.3805, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3700, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3653, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3631, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 5900\n",
      "[0.2        0.89333333 0.91333333 0.90833333 0.91       0.90833333]\n",
      "[tensor(12.6595, device='cuda:0') tensor(0.3186, device='cuda:0')\n",
      " tensor(0.2833, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2890, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2834, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2814, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6000\n",
      "[0.2        0.87666667 0.88       0.88333333 0.89833333 0.9       ]\n",
      "[tensor(12.8017, device='cuda:0') tensor(0.3326, device='cuda:0')\n",
      " tensor(0.3392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3148, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2895, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2882, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.823  0.838  0.8447 0.847  0.8486]\n",
      "epoch: 6100\n",
      "[0.2        0.945      0.95333333 0.95333333 0.95666667 0.95833333]\n",
      "[tensor(12.6286, device='cuda:0') tensor(0.2006, device='cuda:0')\n",
      " tensor(0.1732, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1661, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1620, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1591, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6200\n",
      "[0.2        0.92666667 0.945      0.94833333 0.95333333 0.95333333]\n",
      "[tensor(12.7658, device='cuda:0') tensor(0.2278, device='cuda:0')\n",
      " tensor(0.1883, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1795, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1744, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1707, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6300\n",
      "[0.2        0.84833333 0.85666667 0.86333333 0.86833333 0.87166667]\n",
      "[tensor(13.0203, device='cuda:0') tensor(0.4028, device='cuda:0')\n",
      " tensor(0.4978, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4287, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.4586, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3719, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6400\n",
      "[0.2        0.91333333 0.935      0.93333333 0.935      0.93333333]\n",
      "[tensor(12.9182, device='cuda:0') tensor(0.2440, device='cuda:0')\n",
      " tensor(0.2041, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1988, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1953, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1928, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6500\n",
      "[0.2        0.86666667 0.89       0.88833333 0.89       0.89166667]\n",
      "[tensor(12.9846, device='cuda:0') tensor(0.3399, device='cuda:0')\n",
      " tensor(0.2988, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2964, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2953, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2943, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 6600\n",
      "[0.2        0.92       0.91333333 0.925      0.92166667 0.92333333]\n",
      "[tensor(13.0907, device='cuda:0') tensor(0.2292, device='cuda:0')\n",
      " tensor(0.2271, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2065, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2063, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2055, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6700\n",
      "[0.2        0.93       0.94166667 0.94333333 0.94333333 0.945     ]\n",
      "[tensor(13.2028, device='cuda:0') tensor(0.2456, device='cuda:0')\n",
      " tensor(0.2240, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2138, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2111, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6800\n",
      "[0.2        0.92       0.94       0.94166667 0.945      0.945     ]\n",
      "[tensor(13.0057, device='cuda:0') tensor(0.2091, device='cuda:0')\n",
      " tensor(0.1738, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1665, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1617, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1583, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 6900\n",
      "[0.2        0.94333333 0.95666667 0.95666667 0.955      0.95666667]\n",
      "[tensor(13.1077, device='cuda:0') tensor(0.1914, device='cuda:0')\n",
      " tensor(0.1555, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1520, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1493, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1477, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7000\n",
      "[0.2        0.945      0.94833333 0.95333333 0.95666667 0.95833333]\n",
      "[tensor(13.3101, device='cuda:0') tensor(0.1716, device='cuda:0')\n",
      " tensor(0.1910, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1664, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1619, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1587, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8306 0.843  0.8467 0.8486 0.8496]\n",
      "epoch: 7100\n",
      "[0.2        0.88333333 0.875      0.885      0.89166667 0.89166667]\n",
      "[tensor(13.5298, device='cuda:0') tensor(0.2904, device='cuda:0')\n",
      " tensor(0.3282, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3451, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3072, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3054, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7200\n",
      "[0.2        0.86333333 0.86166667 0.87833333 0.88       0.88      ]\n",
      "[tensor(13.6991, device='cuda:0') tensor(0.3721, device='cuda:0')\n",
      " tensor(0.4013, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3389, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3350, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7300\n",
      "[0.2        0.95333333 0.95833333 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(13.7999, device='cuda:0') tensor(0.1694, device='cuda:0')\n",
      " tensor(0.1432, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1370, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1329, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1299, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7400\n",
      "[0.2        0.94       0.94833333 0.95166667 0.95333333 0.95166667]\n",
      "[tensor(13.3318, device='cuda:0') tensor(0.1787, device='cuda:0')\n",
      " tensor(0.1601, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1553, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1518, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1491, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7500\n",
      "[0.2        0.89666667 0.90333333 0.90833333 0.91       0.90833333]\n",
      "[tensor(13.7563, device='cuda:0') tensor(0.2846, device='cuda:0')\n",
      " tensor(0.2726, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2677, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2644, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2618, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7600\n",
      "[0.2        0.9        0.90833333 0.90666667 0.90666667 0.905     ]\n",
      "[tensor(13.5631, device='cuda:0') tensor(0.3020, device='cuda:0')\n",
      " tensor(0.2758, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2698, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2663, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2637, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7700\n",
      "[0.2        0.91833333 0.93333333 0.93333333 0.93666667 0.93166667]\n",
      "[tensor(13.7824, device='cuda:0') tensor(0.2229, device='cuda:0')\n",
      " tensor(0.3314, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2235, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2953, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2308, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7800\n",
      "[0.2        0.87166667 0.89333333 0.895      0.895      0.89166667]\n",
      "[tensor(14.2842, device='cuda:0') tensor(0.3379, device='cuda:0')\n",
      " tensor(0.2865, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2781, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2766, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 7900\n",
      "[0.2        0.92333333 0.91166667 0.92333333 0.925      0.92333333]\n",
      "[tensor(13.7747, device='cuda:0') tensor(0.2224, device='cuda:0')\n",
      " tensor(0.2727, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2115, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2184, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2179, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8000\n",
      "[0.2        0.91166667 0.91833333 0.92166667 0.92333333 0.92333333]\n",
      "[tensor(13.8293, device='cuda:0') tensor(0.2169, device='cuda:0')\n",
      " tensor(0.1947, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1896, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1866, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1845, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8477 0.8555 0.861  0.863  0.864 ]\n",
      "epoch: 8100\n",
      "[0.2        0.88166667 0.90833333 0.91166667 0.91166667 0.91333333]\n",
      "[tensor(14.1170, device='cuda:0') tensor(0.3088, device='cuda:0')\n",
      " tensor(0.2561, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2469, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2404, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2351, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8200\n",
      "[0.2        0.91666667 0.92666667 0.93166667 0.93166667 0.93333333]\n",
      "[tensor(13.9380, device='cuda:0') tensor(0.2493, device='cuda:0')\n",
      " tensor(0.2251, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2192, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2164, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2145, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8300\n",
      "[0.2   0.9   0.925 0.94  0.94  0.94 ]\n",
      "[tensor(14.1307, device='cuda:0') tensor(0.2784, device='cuda:0')\n",
      " tensor(0.2373, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2051, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2016, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1989, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8400\n",
      "[0.2        0.925      0.94333333 0.93833333 0.94       0.94166667]\n",
      "[tensor(13.9764, device='cuda:0') tensor(0.2223, device='cuda:0')\n",
      " tensor(0.1920, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1874, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1852, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1837, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8500\n",
      "[0.2        0.92333333 0.92833333 0.92833333 0.92833333 0.92833333]\n",
      "[tensor(14.0747, device='cuda:0') tensor(0.2181, device='cuda:0')\n",
      " tensor(0.1949, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1922, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1906, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1893, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8600\n",
      "[0.2        0.91       0.90833333 0.91666667 0.91333333 0.91166667]\n",
      "[tensor(13.8014, device='cuda:0') tensor(0.2502, device='cuda:0')\n",
      " tensor(0.2380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2289, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2244, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2212, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8700\n",
      "[0.2        0.91333333 0.915      0.925      0.92666667 0.92833333]\n",
      "[tensor(14.1583, device='cuda:0') tensor(0.2617, device='cuda:0')\n",
      " tensor(0.2504, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2415, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2391, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2373, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 8800\n",
      "[0.2        0.90833333 0.935      0.935      0.935      0.93666667]\n",
      "[tensor(13.8422, device='cuda:0') tensor(0.2537, device='cuda:0')\n",
      " tensor(0.1910, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1870, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1840, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1817, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 8900\n",
      "[0.2        0.915      0.89833333 0.92666667 0.92666667 0.93      ]\n",
      "[tensor(14.1322, device='cuda:0') tensor(0.2398, device='cuda:0')\n",
      " tensor(0.2649, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1960, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1940, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1925, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9000\n",
      "[0.2        0.95666667 0.95833333 0.95833333 0.95833333 0.95833333]\n",
      "[tensor(14.0523, device='cuda:0') tensor(0.1334, device='cuda:0')\n",
      " tensor(0.1305, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1292, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1285, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1280, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8525 0.8604 0.863  0.865  0.8657]\n",
      "epoch: 9100\n",
      "[0.2        0.955      0.96       0.96833333 0.96833333 0.96666667]\n",
      "[tensor(14.0868, device='cuda:0') tensor(0.1353, device='cuda:0')\n",
      " tensor(0.1193, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1159, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1119, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9200\n",
      "[0.2        0.93666667 0.945      0.945      0.94333333 0.94333333]\n",
      "[tensor(13.8137, device='cuda:0') tensor(0.1638, device='cuda:0')\n",
      " tensor(0.1456, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1427, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9300\n",
      "[0.2        0.91       0.91       0.91333333 0.915      0.915     ]\n",
      "[tensor(14.1248, device='cuda:0') tensor(0.2378, device='cuda:0')\n",
      " tensor(0.2302, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2258, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2231, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2211, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9400\n",
      "[0.2        0.95       0.95       0.95       0.94833333 0.95      ]\n",
      "[tensor(14.1508, device='cuda:0') tensor(0.1501, device='cuda:0')\n",
      " tensor(0.1417, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1395, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1379, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1368, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9500\n",
      "[0.2        0.95833333 0.96166667 0.96       0.96       0.96      ]\n",
      "[tensor(14.1529, device='cuda:0') tensor(0.1367, device='cuda:0')\n",
      " tensor(0.1316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1268, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1252, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9600\n",
      "[0.2        0.93833333 0.955      0.955      0.95666667 0.95666667]\n",
      "[tensor(13.9044, device='cuda:0') tensor(0.1885, device='cuda:0')\n",
      " tensor(0.1625, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1595, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1573, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1555, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9700\n",
      "[0.2        0.92333333 0.93       0.93666667 0.93666667 0.93333333]\n",
      "[tensor(13.9012, device='cuda:0') tensor(0.2252, device='cuda:0')\n",
      " tensor(0.2174, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2095, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2062, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2038, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9800\n",
      "[0.2        0.94333333 0.92666667 0.93666667 0.93666667 0.93666667]\n",
      "[tensor(14.2374, device='cuda:0') tensor(0.1625, device='cuda:0')\n",
      " tensor(0.2343, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1945, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1914, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1890, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 9900\n",
      "[0.2        0.91       0.92333333 0.92333333 0.92333333 0.925     ]\n",
      "[tensor(14.3801, device='cuda:0') tensor(0.2432, device='cuda:0')\n",
      " tensor(0.2179, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2116, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2097, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10000\n",
      "[0.2        0.915      0.91666667 0.92166667 0.92       0.92333333]\n",
      "[tensor(13.8342, device='cuda:0') tensor(0.2104, device='cuda:0')\n",
      " tensor(0.2098, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1988, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1981, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1968, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8613 0.8657 0.869  0.8706 0.8716]\n",
      "epoch: 10100\n",
      "[0.2        0.89833333 0.89833333 0.90666667 0.905      0.90833333]\n",
      "[tensor(14.1698, device='cuda:0') tensor(0.2677, device='cuda:0')\n",
      " tensor(0.3931, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2758, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2840, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2609, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10200\n",
      "[0.2        0.93666667 0.94666667 0.94666667 0.94833333 0.95      ]\n",
      "[tensor(14.0938, device='cuda:0') tensor(0.1793, device='cuda:0')\n",
      " tensor(0.1574, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1527, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1480, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10300\n",
      "[0.2        0.945      0.95       0.94833333 0.94833333 0.94666667]\n",
      "[tensor(13.9806, device='cuda:0') tensor(0.1574, device='cuda:0')\n",
      " tensor(0.1403, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1376, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1360, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1349, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10400\n",
      "[0.2        0.95       0.95166667 0.95333333 0.95333333 0.95333333]\n",
      "[tensor(14.1587, device='cuda:0') tensor(0.1586, device='cuda:0')\n",
      " tensor(0.1554, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1533, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1517, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1503, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10500\n",
      "[0.2        0.98166667 0.98       0.98       0.98       0.98      ]\n",
      "[tensor(14.2986, device='cuda:0') tensor(0.0832, device='cuda:0')\n",
      " tensor(0.0823, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0815, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0808, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10600\n",
      "[0.2        0.95666667 0.95666667 0.95833333 0.95666667 0.955     ]\n",
      "[tensor(14.3242, device='cuda:0') tensor(0.1187, device='cuda:0')\n",
      " tensor(0.1153, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1134, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1128, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10700\n",
      "[0.2        0.97333333 0.97166667 0.97166667 0.97       0.97      ]\n",
      "[tensor(14.1045, device='cuda:0') tensor(0.1128, device='cuda:0')\n",
      " tensor(0.1066, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1036, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1014, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0997, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10800\n",
      "[0.2        0.92333333 0.935      0.94       0.94       0.94166667]\n",
      "[tensor(14.3500, device='cuda:0') tensor(0.2057, device='cuda:0')\n",
      " tensor(0.1762, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1772, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1741, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1713, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 10900\n",
      "[0.2        0.89       0.9        0.9        0.89833333 0.90333333]\n",
      "[tensor(13.9268, device='cuda:0') tensor(0.2662, device='cuda:0')\n",
      " tensor(0.2580, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2623, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2601, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2599, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 11000\n",
      "[0.2   0.955 0.955 0.955 0.955 0.955]\n",
      "[tensor(14.0545, device='cuda:0') tensor(0.1511, device='cuda:0')\n",
      " tensor(0.1488, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1476, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1461, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.868  0.873  0.8745 0.876  0.8765]\n",
      "epoch: 11100\n",
      "[0.2        0.95333333 0.95666667 0.95666667 0.95666667 0.95833333]\n",
      "[tensor(14.3436, device='cuda:0') tensor(0.1483, device='cuda:0')\n",
      " tensor(0.1472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1475, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1479, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1479, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11200\n",
      "[0.2        0.97166667 0.975      0.975      0.975      0.975     ]\n",
      "[tensor(14.0840, device='cuda:0') tensor(0.0953, device='cuda:0')\n",
      " tensor(0.0883, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0863, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0847, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0833, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11300\n",
      "[0.2        0.95666667 0.95833333 0.95833333 0.96       0.96166667]\n",
      "[tensor(14.0247, device='cuda:0') tensor(0.1173, device='cuda:0')\n",
      " tensor(0.1129, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1111, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1100, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1091, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11400\n",
      "[0.2        0.94833333 0.94666667 0.95       0.95166667 0.95166667]\n",
      "[tensor(13.9773, device='cuda:0') tensor(0.1717, device='cuda:0')\n",
      " tensor(0.1624, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1581, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1567, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11500\n",
      "[0.2        0.9        0.91       0.91166667 0.91166667 0.91333333]\n",
      "[tensor(14.4056, device='cuda:0') tensor(0.2674, device='cuda:0')\n",
      " tensor(0.2454, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2397, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2328, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11600\n",
      "[0.2        0.94666667 0.94833333 0.95       0.95166667 0.95166667]\n",
      "[tensor(14.1017, device='cuda:0') tensor(0.1971, device='cuda:0')\n",
      " tensor(0.1947, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1933, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1923, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1915, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11700\n",
      "[0.2        0.92166667 0.92166667 0.92       0.92333333 0.92333333]\n",
      "[tensor(14.1808, device='cuda:0') tensor(0.2384, device='cuda:0')\n",
      " tensor(0.2248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2215, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2193, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2176, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11800\n",
      "[0.2        0.95166667 0.95833333 0.96       0.96       0.96166667]\n",
      "[tensor(14.1615, device='cuda:0') tensor(0.1108, device='cuda:0')\n",
      " tensor(0.1029, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1004, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0990, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0979, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 11900\n",
      "[0.2        0.90166667 0.905      0.90833333 0.90666667 0.91166667]\n",
      "[tensor(13.9216, device='cuda:0') tensor(0.2485, device='cuda:0')\n",
      " tensor(0.2321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2270, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2211, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12000\n",
      "[0.2        0.93       0.92       0.93833333 0.94       0.945     ]\n",
      "[tensor(14.0474, device='cuda:0') tensor(0.1816, device='cuda:0')\n",
      " tensor(0.2830, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1824, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1809, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1800, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8716 0.875  0.8774 0.878  0.8784]\n",
      "epoch: 12100\n",
      "[0.2        0.94666667 0.95       0.95166667 0.95166667 0.955     ]\n",
      "[tensor(13.8848, device='cuda:0') tensor(0.1233, device='cuda:0')\n",
      " tensor(0.1103, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1057, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1044, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1033, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12200\n",
      "[0.2        0.96166667 0.96333333 0.96666667 0.96833333 0.97333333]\n",
      "[tensor(13.9476, device='cuda:0') tensor(0.1044, device='cuda:0')\n",
      " tensor(0.0996, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0975, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0961, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0951, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12300\n",
      "[0.2        0.96       0.96333333 0.96333333 0.96333333 0.965     ]\n",
      "[tensor(14.2060, device='cuda:0') tensor(0.1118, device='cuda:0')\n",
      " tensor(0.1082, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1065, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1053, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1043, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12400\n",
      "[0.2        0.885      0.88333333 0.87       0.86666667 0.86666667]\n",
      "[tensor(14.1876, device='cuda:0') tensor(0.3182, device='cuda:0')\n",
      " tensor(0.3758, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5587, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5096, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.5088, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12500\n",
      "[0.2        0.92166667 0.92       0.92166667 0.92166667 0.92166667]\n",
      "[tensor(13.8625, device='cuda:0') tensor(0.2546, device='cuda:0')\n",
      " tensor(0.2487, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2461, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2429, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12600\n",
      "[0.2        0.96       0.96166667 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(13.7779, device='cuda:0') tensor(0.1230, device='cuda:0')\n",
      " tensor(0.1219, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1213, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1210, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1208, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12700\n",
      "[0.2        0.96166667 0.96166667 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(14.1390, device='cuda:0') tensor(0.1395, device='cuda:0')\n",
      " tensor(0.1357, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1304, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1293, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12800\n",
      "[0.2        0.96666667 0.965      0.965      0.965      0.96666667]\n",
      "[tensor(14.0216, device='cuda:0') tensor(0.0925, device='cuda:0')\n",
      " tensor(0.0892, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0881, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0873, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0866, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 12900\n",
      "[0.2        0.93833333 0.94333333 0.94333333 0.94333333 0.94833333]\n",
      "[tensor(14.0581, device='cuda:0') tensor(0.1796, device='cuda:0')\n",
      " tensor(0.1799, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1798, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1809, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1813, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13000\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(14.0925, device='cuda:0') tensor(0.0878, device='cuda:0')\n",
      " tensor(0.0858, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0852, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0847, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0843, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.876  0.878  0.8794 0.8804 0.881 ]\n",
      "epoch: 13100\n",
      "[0.2        0.95666667 0.95666667 0.95666667 0.95666667 0.95666667]\n",
      "[tensor(14.0592, device='cuda:0') tensor(0.1361, device='cuda:0')\n",
      " tensor(0.1340, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1311, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1300, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 13200\n",
      "[0.2        0.94       0.945      0.94666667 0.945      0.945     ]\n",
      "[tensor(14.1751, device='cuda:0') tensor(0.1564, device='cuda:0')\n",
      " tensor(0.1516, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1521, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1522, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1523, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13300\n",
      "[0.2        0.96666667 0.96666667 0.96833333 0.97       0.97      ]\n",
      "[tensor(14.3076, device='cuda:0') tensor(0.0964, device='cuda:0')\n",
      " tensor(0.0921, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0900, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0884, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0871, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13400\n",
      "[0.2        0.90333333 0.90666667 0.90666667 0.90666667 0.90666667]\n",
      "[tensor(14.1328, device='cuda:0') tensor(0.2711, device='cuda:0')\n",
      " tensor(0.2564, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2522, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2498, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2481, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13500\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.96833333 0.97      ]\n",
      "[tensor(14.1841, device='cuda:0') tensor(0.0957, device='cuda:0')\n",
      " tensor(0.0916, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0905, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0898, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0893, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13600\n",
      "[0.2        0.92833333 0.92833333 0.93       0.93166667 0.93166667]\n",
      "[tensor(13.8748, device='cuda:0') tensor(0.2008, device='cuda:0')\n",
      " tensor(0.1972, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1949, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1932, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1918, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13700\n",
      "[0.2        0.95166667 0.95333333 0.95666667 0.95666667 0.955     ]\n",
      "[tensor(13.8151, device='cuda:0') tensor(0.1214, device='cuda:0')\n",
      " tensor(0.1085, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1081, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1079, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1078, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13800\n",
      "[0.2        0.97333333 0.97       0.97333333 0.97333333 0.97333333]\n",
      "[tensor(14.0590, device='cuda:0') tensor(0.0843, device='cuda:0')\n",
      " tensor(0.0853, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0813, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0805, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0798, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 13900\n",
      "[0.2        0.93333333 0.94333333 0.94333333 0.945      0.945     ]\n",
      "[tensor(13.9978, device='cuda:0') tensor(0.1786, device='cuda:0')\n",
      " tensor(0.1728, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1710, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1696, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1685, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14000\n",
      "[0.2        0.93666667 0.93833333 0.93833333 0.93833333 0.93666667]\n",
      "[tensor(14.1393, device='cuda:0') tensor(0.1967, device='cuda:0')\n",
      " tensor(0.1925, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1903, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1889, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1879, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8823 0.884  0.8853 0.8857 0.8857]\n",
      "epoch: 14100\n",
      "[0.2        0.95       0.95166667 0.95333333 0.95333333 0.95333333]\n",
      "[tensor(14.1354, device='cuda:0') tensor(0.1387, device='cuda:0')\n",
      " tensor(0.1367, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1354, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1345, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1339, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14200\n",
      "[0.2        0.94333333 0.94       0.93666667 0.93666667 0.93666667]\n",
      "[tensor(14.1548, device='cuda:0') tensor(0.1716, device='cuda:0')\n",
      " tensor(0.1695, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1692, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1690, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1689, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14300\n",
      "[0.2        0.95666667 0.97       0.97       0.97       0.97166667]\n",
      "[tensor(14.0646, device='cuda:0') tensor(0.1184, device='cuda:0')\n",
      " tensor(0.0930, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0913, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0900, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0890, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14400\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(13.8343, device='cuda:0') tensor(0.0825, device='cuda:0')\n",
      " tensor(0.0822, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0820, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0817, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0815, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14500\n",
      "[0.2        0.97833333 0.97833333 0.98       0.98       0.98      ]\n",
      "[tensor(13.9201, device='cuda:0') tensor(0.0838, device='cuda:0')\n",
      " tensor(0.0803, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0784, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0771, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0762, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14600\n",
      "[0.2        0.95833333 0.96666667 0.96666667 0.96666667 0.96833333]\n",
      "[tensor(13.9550, device='cuda:0') tensor(0.1044, device='cuda:0')\n",
      " tensor(0.0907, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0907, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0906, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0906, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14700\n",
      "[0.2        0.92833333 0.93       0.93333333 0.93333333 0.93333333]\n",
      "[tensor(13.8617, device='cuda:0') tensor(0.1698, device='cuda:0')\n",
      " tensor(0.1672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1661, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1653, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1647, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14800\n",
      "[0.2        0.94       0.93833333 0.93833333 0.94       0.94      ]\n",
      "[tensor(13.9059, device='cuda:0') tensor(0.1539, device='cuda:0')\n",
      " tensor(0.1509, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1497, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1491, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1486, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 14900\n",
      "[0.2        0.93666667 0.94       0.94       0.94       0.94      ]\n",
      "[tensor(13.6025, device='cuda:0') tensor(0.2056, device='cuda:0')\n",
      " tensor(0.1803, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1777, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1759, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1745, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15000\n",
      "[0.2        0.97       0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(13.7002, device='cuda:0') tensor(0.0958, device='cuda:0')\n",
      " tensor(0.0935, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0922, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0913, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0906, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.889  0.891  0.892  0.8926 0.893 ]\n",
      "epoch: 15100\n",
      "[0.2        0.91333333 0.91333333 0.91666667 0.91833333 0.91833333]\n",
      "[tensor(13.8795, device='cuda:0') tensor(0.2377, device='cuda:0')\n",
      " tensor(0.3676, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3373, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3398, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3422, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15200\n",
      "[0.2        0.94333333 0.945      0.95166667 0.94833333 0.94833333]\n",
      "[tensor(13.3177, device='cuda:0') tensor(0.1424, device='cuda:0')\n",
      " tensor(0.1254, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1339, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1356, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15300\n",
      "[0.2        0.96833333 0.97       0.97       0.97       0.97      ]\n",
      "[tensor(13.8498, device='cuda:0') tensor(0.0986, device='cuda:0')\n",
      " tensor(0.0971, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0960, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0951, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0943, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 15400\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.97       0.97      ]\n",
      "[tensor(13.9597, device='cuda:0') tensor(0.0846, device='cuda:0')\n",
      " tensor(0.0831, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0820, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0812, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0805, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15500\n",
      "[0.2        0.97833333 0.97666667 0.97666667 0.975      0.975     ]\n",
      "[tensor(13.7059, device='cuda:0') tensor(0.0894, device='cuda:0')\n",
      " tensor(0.0886, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0879, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0873, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15600\n",
      "[0.2        0.95666667 0.95666667 0.95666667 0.955      0.955     ]\n",
      "[tensor(13.8709, device='cuda:0') tensor(0.1356, device='cuda:0')\n",
      " tensor(0.1336, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1312, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15700\n",
      "[0.2        0.98       0.98       0.98166667 0.98166667 0.98166667]\n",
      "[tensor(13.7116, device='cuda:0') tensor(0.0656, device='cuda:0')\n",
      " tensor(0.0654, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0652, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0650, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0649, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15800\n",
      "[0.2        0.955      0.95333333 0.955      0.95666667 0.95666667]\n",
      "[tensor(13.6454, device='cuda:0') tensor(0.1657, device='cuda:0')\n",
      " tensor(0.1673, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1670, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1667, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1665, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 15900\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(13.5613, device='cuda:0') tensor(0.0591, device='cuda:0')\n",
      " tensor(0.0584, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0579, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0571, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16000\n",
      "[0.2   0.965 0.965 0.965 0.965 0.965]\n",
      "[tensor(13.5611, device='cuda:0') tensor(0.0922, device='cuda:0')\n",
      " tensor(0.0919, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0917, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0916, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0914, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8936 0.894  0.895  0.8955 0.8955]\n",
      "epoch: 16100\n",
      "[0.2        0.94       0.945      0.95       0.95166667 0.95166667]\n",
      "[tensor(13.6441, device='cuda:0') tensor(0.1632, device='cuda:0')\n",
      " tensor(0.1510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1420, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16200\n",
      "[0.2        0.96166667 0.96166667 0.96166667 0.96166667 0.96      ]\n",
      "[tensor(13.3597, device='cuda:0') tensor(0.1285, device='cuda:0')\n",
      " tensor(0.1262, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1250, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1242, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1236, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16300\n",
      "[0.2        0.98       0.985      0.98333333 0.98333333 0.98333333]\n",
      "[tensor(13.5279, device='cuda:0') tensor(0.0603, device='cuda:0')\n",
      " tensor(0.0536, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0520, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0509, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0501, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16400\n",
      "[0.2        0.96666667 0.97166667 0.97166667 0.97166667 0.97      ]\n",
      "[tensor(13.5959, device='cuda:0') tensor(0.0889, device='cuda:0')\n",
      " tensor(0.0856, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0849, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0845, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0842, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16500\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(13.4939, device='cuda:0') tensor(0.0682, device='cuda:0')\n",
      " tensor(0.0664, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0655, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0648, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0643, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16600\n",
      "[0.2        0.96166667 0.96       0.96       0.96       0.96      ]\n",
      "[tensor(13.2996, device='cuda:0') tensor(0.1214, device='cuda:0')\n",
      " tensor(0.1214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1214, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16700\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(13.2173, device='cuda:0') tensor(0.0394, device='cuda:0')\n",
      " tensor(0.0393, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0391, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16800\n",
      "[0.2        0.95666667 0.955      0.955      0.955      0.955     ]\n",
      "[tensor(13.2579, device='cuda:0') tensor(0.1363, device='cuda:0')\n",
      " tensor(0.1392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1394, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1395, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1395, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 16900\n",
      "[0.2        0.97       0.97333333 0.97333333 0.975      0.975     ]\n",
      "[tensor(13.3228, device='cuda:0') tensor(0.0872, device='cuda:0')\n",
      " tensor(0.0844, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0840, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0837, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0834, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17000\n",
      "[0.2        0.945      0.945      0.945      0.94333333 0.94333333]\n",
      "[tensor(12.9273, device='cuda:0') tensor(0.1745, device='cuda:0')\n",
      " tensor(0.1743, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1741, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1739, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1737, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.8926 0.893  0.894  0.8945 0.8945]\n",
      "epoch: 17100\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(13.0771, device='cuda:0') tensor(0.0601, device='cuda:0')\n",
      " tensor(0.0576, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0571, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0567, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0565, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17200\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(13.2815, device='cuda:0') tensor(0.0718, device='cuda:0')\n",
      " tensor(0.0709, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0704, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0701, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0698, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17300\n",
      "[0.2        0.95833333 0.95833333 0.95833333 0.95833333 0.95833333]\n",
      "[tensor(13.1699, device='cuda:0') tensor(0.1028, device='cuda:0')\n",
      " tensor(0.1021, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1011, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1003, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0996, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17400\n",
      "[0.2        0.95833333 0.95833333 0.96       0.96       0.96      ]\n",
      "[tensor(13.2835, device='cuda:0') tensor(0.1054, device='cuda:0')\n",
      " tensor(0.1051, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1048, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1046, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1045, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17500\n",
      "[0.2        0.96166667 0.96666667 0.965      0.965      0.96666667]\n",
      "[tensor(13.2825, device='cuda:0') tensor(0.0990, device='cuda:0')\n",
      " tensor(0.0993, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0988, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0985, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0981, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 17600\n",
      "[0.2        0.94666667 0.94666667 0.94666667 0.94666667 0.94666667]\n",
      "[tensor(13.0577, device='cuda:0') tensor(0.1825, device='cuda:0')\n",
      " tensor(0.1818, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1811, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1805, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1799, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17700\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.96833333 0.96833333]\n",
      "[tensor(13.2382, device='cuda:0') tensor(0.0956, device='cuda:0')\n",
      " tensor(0.0936, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0933, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0932, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0931, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17800\n",
      "[0.2        0.94166667 0.94       0.94       0.94166667 0.94166667]\n",
      "[tensor(13.0043, device='cuda:0') tensor(0.1484, device='cuda:0')\n",
      " tensor(0.2300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2612, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3848, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.3844, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 17900\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.975     ]\n",
      "[tensor(12.8503, device='cuda:0') tensor(0.0853, device='cuda:0')\n",
      " tensor(0.0848, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0844, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0841, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0838, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18000\n",
      "[0.2        0.96666667 0.96666667 0.96666667 0.96666667 0.96666667]\n",
      "[tensor(12.8550, device='cuda:0') tensor(0.1082, device='cuda:0')\n",
      " tensor(0.1074, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1068, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1063, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1059, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.896  0.8975 0.898  0.8984 0.899 ]\n",
      "epoch: 18100\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(12.6876, device='cuda:0') tensor(0.0490, device='cuda:0')\n",
      " tensor(0.0488, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0487, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0486, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0485, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18200\n",
      "[0.2        0.95833333 0.96166667 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(12.7661, device='cuda:0') tensor(0.1055, device='cuda:0')\n",
      " tensor(0.1044, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1038, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1032, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1027, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18300\n",
      "[0.2        0.965      0.965      0.96666667 0.96666667 0.96666667]\n",
      "[tensor(13.0560, device='cuda:0') tensor(0.0890, device='cuda:0')\n",
      " tensor(0.0889, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0888, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0888, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0887, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18400\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.96833333 0.97      ]\n",
      "[tensor(12.7905, device='cuda:0') tensor(0.0810, device='cuda:0')\n",
      " tensor(0.0806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0799, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0796, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18500\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(12.8868, device='cuda:0') tensor(0.0443, device='cuda:0')\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0438, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18600\n",
      "[0.2        0.97833333 0.97833333 0.98       0.98       0.98      ]\n",
      "[tensor(12.8738, device='cuda:0') tensor(0.0575, device='cuda:0')\n",
      " tensor(0.0569, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0565, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0562, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18700\n",
      "[0.2        0.93       0.93333333 0.93333333 0.93333333 0.93333333]\n",
      "[tensor(13.0303, device='cuda:0') tensor(0.1771, device='cuda:0')\n",
      " tensor(0.1676, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1679, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1683, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1687, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18800\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(12.8559, device='cuda:0') tensor(0.0474, device='cuda:0')\n",
      " tensor(0.0473, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 18900\n",
      "[0.2        0.96833333 0.97       0.97       0.97       0.97      ]\n",
      "[tensor(12.9064, device='cuda:0') tensor(0.1041, device='cuda:0')\n",
      " tensor(0.1032, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1031, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1030, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1029, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19000\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(12.8559, device='cuda:0') tensor(0.0788, device='cuda:0')\n",
      " tensor(0.0785, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0783, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0780, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0778, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9033 0.9033 0.904  0.904  0.9043]\n",
      "epoch: 19100\n",
      "[0.2        0.98166667 0.98333333 0.98333333 0.985      0.985     ]\n",
      "[tensor(13.0033, device='cuda:0') tensor(0.0601, device='cuda:0')\n",
      " tensor(0.0587, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0580, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0571, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19200\n",
      "[0.2        0.96333333 0.965      0.965      0.96333333 0.96333333]\n",
      "[tensor(12.8982, device='cuda:0') tensor(0.1108, device='cuda:0')\n",
      " tensor(0.1106, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1104, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1100, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19300\n",
      "[0.2  0.95 0.95 0.95 0.95 0.95]\n",
      "[tensor(12.7714, device='cuda:0') tensor(0.1336, device='cuda:0')\n",
      " tensor(0.1332, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1329, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1322, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19400\n",
      "[0.2        0.96666667 0.96666667 0.96666667 0.96666667 0.96666667]\n",
      "[tensor(12.7210, device='cuda:0') tensor(0.0770, device='cuda:0')\n",
      " tensor(0.0769, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0769, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0769, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0769, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19500\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(12.7316, device='cuda:0') tensor(0.0565, device='cuda:0')\n",
      " tensor(0.0564, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0563, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0562, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0561, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19600\n",
      "[0.2        0.94833333 0.95666667 0.95333333 0.955      0.955     ]\n",
      "[tensor(12.9640, device='cuda:0') tensor(0.1222, device='cuda:0')\n",
      " tensor(0.1227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1159, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1146, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1142, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19700\n",
      "[0.2        0.945      0.94166667 0.94166667 0.94333333 0.94333333]\n",
      "[tensor(12.8654, device='cuda:0') tensor(0.1469, device='cuda:0')\n",
      " tensor(0.1505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1532, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1555, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1572, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 19800\n",
      "[0.2        0.96166667 0.96166667 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(12.5370, device='cuda:0') tensor(0.0996, device='cuda:0')\n",
      " tensor(0.0983, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0978, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0974, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0971, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 19900\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(13.0251, device='cuda:0') tensor(0.0494, device='cuda:0')\n",
      " tensor(0.0490, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0486, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0483, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0480, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20000\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(12.6639, device='cuda:0') tensor(0.0366, device='cuda:0')\n",
      " tensor(0.0364, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0363, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0361, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.906  0.9067 0.907  0.907  0.907 ]\n",
      "epoch: 20100\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(12.7710, device='cuda:0') tensor(0.0497, device='cuda:0')\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0500, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0502, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0503, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20200\n",
      "[0.2        0.955      0.95833333 0.95833333 0.95833333 0.95833333]\n",
      "[tensor(12.6766, device='cuda:0') tensor(0.1002, device='cuda:0')\n",
      " tensor(0.0986, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0982, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0979, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0975, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20300\n",
      "[0.2        0.92833333 0.925      0.925      0.925      0.92333333]\n",
      "[tensor(12.6565, device='cuda:0') tensor(0.1481, device='cuda:0')\n",
      " tensor(0.1557, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1568, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1577, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1584, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20400\n",
      "[0.2        0.95666667 0.95666667 0.95666667 0.95666667 0.95833333]\n",
      "[tensor(12.6728, device='cuda:0') tensor(0.0900, device='cuda:0')\n",
      " tensor(0.0891, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0884, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0878, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0872, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20500\n",
      "[0.2        0.96166667 0.96166667 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(12.6108, device='cuda:0') tensor(0.1232, device='cuda:0')\n",
      " tensor(0.1232, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1232, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1232, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1231, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20600\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(12.6906, device='cuda:0') tensor(0.0608, device='cuda:0')\n",
      " tensor(0.0606, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0605, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0604, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0602, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20700\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(12.6236, device='cuda:0') tensor(0.0743, device='cuda:0')\n",
      " tensor(0.0740, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0737, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0735, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0732, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20800\n",
      "[0.2        0.94833333 0.94666667 0.94666667 0.94666667 0.94666667]\n",
      "[tensor(12.4433, device='cuda:0') tensor(0.1584, device='cuda:0')\n",
      " tensor(0.1591, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1595, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1600, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1603, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 20900\n",
      "[0.2        0.95333333 0.95333333 0.95333333 0.95333333 0.95333333]\n",
      "[tensor(12.7377, device='cuda:0') tensor(0.1296, device='cuda:0')\n",
      " tensor(0.1296, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1296, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1296, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1296, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21000\n",
      "[0.2        0.92833333 0.925      0.925      0.925      0.925     ]\n",
      "[tensor(12.8374, device='cuda:0') tensor(0.1648, device='cuda:0')\n",
      " tensor(0.1644, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1644, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1646, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1648, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9077 0.9077 0.908  0.908  0.9087]\n",
      "epoch: 21100\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(12.5604, device='cuda:0') tensor(0.0696, device='cuda:0')\n",
      " tensor(0.0695, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0694, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0693, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0692, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21200\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(12.4653, device='cuda:0') tensor(0.0500, device='cuda:0')\n",
      " tensor(0.0500, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21300\n",
      "[0.2        0.96833333 0.96833333 0.97       0.97       0.97      ]\n",
      "[tensor(12.8204, device='cuda:0') tensor(0.0783, device='cuda:0')\n",
      " tensor(0.0782, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0781, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0780, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0779, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21400\n",
      "[0.2        0.98333333 0.98333333 0.985      0.985      0.985     ]\n",
      "[tensor(12.5984, device='cuda:0') tensor(0.0559, device='cuda:0')\n",
      " tensor(0.0549, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0544, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0540, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0537, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21500\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(12.3966, device='cuda:0') tensor(0.0618, device='cuda:0')\n",
      " tensor(0.0614, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0610, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0607, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0605, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21600\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(12.3471, device='cuda:0') tensor(0.0549, device='cuda:0')\n",
      " tensor(0.0549, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0548, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0548, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0548, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21700\n",
      "[0.2        0.89166667 0.89333333 0.905      0.905      0.905     ]\n",
      "[tensor(12.4283, device='cuda:0') tensor(0.2225, device='cuda:0')\n",
      " tensor(0.2284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2233, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2279, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.2321, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21800\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.96833333 0.96666667]\n",
      "[tensor(12.8075, device='cuda:0') tensor(0.0987, device='cuda:0')\n",
      " tensor(0.0981, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0976, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0972, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0968, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 21900\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(12.4545, device='cuda:0') tensor(0.0463, device='cuda:0')\n",
      " tensor(0.0460, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0458, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0456, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0454, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 22000\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(12.5390, device='cuda:0') tensor(0.0704, device='cuda:0')\n",
      " tensor(0.0707, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0707, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0707, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0707, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.905 0.906 0.906 0.906 0.906]\n",
      "epoch: 22100\n",
      "[0.2        0.96333333 0.965      0.965      0.965      0.965     ]\n",
      "[tensor(12.3234, device='cuda:0') tensor(0.0839, device='cuda:0')\n",
      " tensor(0.0825, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0817, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0813, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0809, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22200\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(12.3862, device='cuda:0') tensor(0.0828, device='cuda:0')\n",
      " tensor(0.0829, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0830, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0831, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0831, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22300\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(12.3650, device='cuda:0') tensor(0.0526, device='cuda:0')\n",
      " tensor(0.0523, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0520, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0517, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0515, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22400\n",
      "[0.2        0.96833333 0.97       0.97       0.97       0.97      ]\n",
      "[tensor(12.2732, device='cuda:0') tensor(0.1024, device='cuda:0')\n",
      " tensor(0.1002, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0994, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0989, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0986, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22500\n",
      "[0.2        0.97333333 0.97333333 0.975      0.97333333 0.97333333]\n",
      "[tensor(12.5543, device='cuda:0') tensor(0.0914, device='cuda:0')\n",
      " tensor(0.0888, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0880, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0875, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0872, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22600\n",
      "[0.2        0.97166667 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(12.3612, device='cuda:0') tensor(0.0817, device='cuda:0')\n",
      " tensor(0.0810, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0799, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22700\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(12.3171, device='cuda:0') tensor(0.0203, device='cuda:0')\n",
      " tensor(0.0203, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0203, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0203, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0203, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22800\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(12.4928, device='cuda:0') tensor(0.0655, device='cuda:0')\n",
      " tensor(0.0654, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0654, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0654, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0653, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 22900\n",
      "[0.2        0.98       0.98       0.98       0.98166667 0.98166667]\n",
      "[tensor(12.4548, device='cuda:0') tensor(0.0635, device='cuda:0')\n",
      " tensor(0.0633, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0631, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0630, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0628, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23000\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(12.1625, device='cuda:0') tensor(0.0502, device='cuda:0')\n",
      " tensor(0.0500, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0497, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0496, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9087 0.909  0.909  0.9097 0.9097]\n",
      "epoch: 23100\n",
      "[0.2  0.97 0.97 0.97 0.97 0.97]\n",
      "[tensor(12.1617, device='cuda:0') tensor(0.1042, device='cuda:0')\n",
      " tensor(0.1041, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1040, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1039, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1038, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23200\n",
      "[0.2        0.945      0.94333333 0.94666667 0.94833333 0.94833333]\n",
      "[tensor(12.2607, device='cuda:0') tensor(0.1501, device='cuda:0')\n",
      " tensor(0.1514, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1503, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1498, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1496, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23300\n",
      "[0.2        0.96666667 0.96666667 0.96666667 0.96666667 0.96666667]\n",
      "[tensor(12.2189, device='cuda:0') tensor(0.0947, device='cuda:0')\n",
      " tensor(0.0936, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0928, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0921, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0915, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23400\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(12.3030, device='cuda:0') tensor(0.0507, device='cuda:0')\n",
      " tensor(0.0506, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0503, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0502, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23500\n",
      "[0.2        0.95166667 0.95       0.95       0.95166667 0.95166667]\n",
      "[tensor(12.1505, device='cuda:0') tensor(0.1325, device='cuda:0')\n",
      " tensor(0.1229, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1234, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1239, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1244, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23600\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(12.4626, device='cuda:0') tensor(0.0792, device='cuda:0')\n",
      " tensor(0.0786, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0782, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0778, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0775, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23700\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(12.2798, device='cuda:0') tensor(0.0324, device='cuda:0')\n",
      " tensor(0.0312, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0307, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0303, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23800\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(12.2420, device='cuda:0') tensor(0.0460, device='cuda:0')\n",
      " tensor(0.0460, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0460, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0460, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0460, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 23900\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(12.3397, device='cuda:0') tensor(0.0387, device='cuda:0')\n",
      " tensor(0.0380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0375, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0371, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0368, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24000\n",
      "[0.2        0.96666667 0.96666667 0.96666667 0.96666667 0.96666667]\n",
      "[tensor(12.2687, device='cuda:0') tensor(0.0826, device='cuda:0')\n",
      " tensor(0.0824, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0823, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0822, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0821, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.908  0.9077 0.9077 0.908  0.908 ]\n",
      "epoch: 24100\n",
      "[0.2        0.97833333 0.97833333 0.98       0.98       0.98      ]\n",
      "[tensor(12.2769, device='cuda:0') tensor(0.0636, device='cuda:0')\n",
      " tensor(0.0623, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0615, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0609, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0604, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 24200\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(12.1257, device='cuda:0') tensor(0.0610, device='cuda:0')\n",
      " tensor(0.0609, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0609, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0608, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0608, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24300\n",
      "[0.2        0.975      0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(12.2157, device='cuda:0') tensor(0.0723, device='cuda:0')\n",
      " tensor(0.0730, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0727, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0725, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0724, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24400\n",
      "[0.2        0.94166667 0.94333333 0.94333333 0.94333333 0.94333333]\n",
      "[tensor(12.0107, device='cuda:0') tensor(0.1533, device='cuda:0')\n",
      " tensor(0.1524, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1522, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1522, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1522, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24500\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(12.0499, device='cuda:0') tensor(0.0439, device='cuda:0')\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24600\n",
      "[0.2        0.98666667 0.98666667 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.9971, device='cuda:0') tensor(0.0365, device='cuda:0')\n",
      " tensor(0.0363, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0360, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0359, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24700\n",
      "[0.2        0.97666667 0.98166667 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(12.4205, device='cuda:0') tensor(0.0552, device='cuda:0')\n",
      " tensor(0.0474, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0441, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0441, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24800\n",
      "[0.2  0.97 0.97 0.97 0.97 0.97]\n",
      "[tensor(12.0642, device='cuda:0') tensor(0.0679, device='cuda:0')\n",
      " tensor(0.0680, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0680, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0680, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0680, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 24900\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(12.1342, device='cuda:0') tensor(0.0777, device='cuda:0')\n",
      " tensor(0.0776, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0776, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0775, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0774, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25000\n",
      "[0.2        0.97666667 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(12.1086, device='cuda:0') tensor(0.0490, device='cuda:0')\n",
      " tensor(0.0482, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0481, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0481, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0481, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9077 0.9077 0.908  0.908  0.908 ]\n",
      "epoch: 25100\n",
      "[0.2        0.95333333 0.95166667 0.95333333 0.95333333 0.95333333]\n",
      "[tensor(12.1867, device='cuda:0') tensor(0.1349, device='cuda:0')\n",
      " tensor(0.1354, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1365, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25200\n",
      "[0.2        0.95833333 0.95833333 0.95833333 0.95833333 0.95833333]\n",
      "[tensor(12.1634, device='cuda:0') tensor(0.0971, device='cuda:0')\n",
      " tensor(0.0971, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0970, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0969, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0968, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25300\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(12.1514, device='cuda:0') tensor(0.0447, device='cuda:0')\n",
      " tensor(0.0444, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0441, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0438, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25400\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(12.1815, device='cuda:0') tensor(0.0577, device='cuda:0')\n",
      " tensor(0.0576, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0574, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0574, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25500\n",
      "[0.2        0.955      0.955      0.95333333 0.95333333 0.95333333]\n",
      "[tensor(12.1402, device='cuda:0') tensor(0.1631, device='cuda:0')\n",
      " tensor(0.1634, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1636, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1638, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1640, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25600\n",
      "[0.2        0.975      0.975      0.975      0.97666667 0.97666667]\n",
      "[tensor(11.9429, device='cuda:0') tensor(0.0609, device='cuda:0')\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0589, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0582, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0576, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25700\n",
      "[0.2   0.965 0.965 0.965 0.965 0.965]\n",
      "[tensor(12.1089, device='cuda:0') tensor(0.0901, device='cuda:0')\n",
      " tensor(0.0901, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0902, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0903, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0903, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25800\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(11.9122, device='cuda:0') tensor(0.0902, device='cuda:0')\n",
      " tensor(0.0890, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0882, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0877, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0873, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 25900\n",
      "[0.2        0.96166667 0.96166667 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(12.0565, device='cuda:0') tensor(0.1111, device='cuda:0')\n",
      " tensor(0.1112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1113, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1114, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1114, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26000\n",
      "[0.2        0.96333333 0.965      0.965      0.96666667 0.96666667]\n",
      "[tensor(11.9319, device='cuda:0') tensor(0.0875, device='cuda:0')\n",
      " tensor(0.0858, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0854, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0850, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0847, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.908  0.9087 0.909  0.9087 0.909 ]\n",
      "epoch: 26100\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(11.9045, device='cuda:0') tensor(0.0513, device='cuda:0')\n",
      " tensor(0.0508, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0504, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0501, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0498, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.9775, device='cuda:0') tensor(0.0343, device='cuda:0')\n",
      " tensor(0.0342, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0340, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0338, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0337, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26300\n",
      "[0.2  0.97 0.97 0.97 0.97 0.97]\n",
      "[tensor(11.9694, device='cuda:0') tensor(0.0937, device='cuda:0')\n",
      " tensor(0.0936, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0936, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0935, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0934, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 26400\n",
      "[0.2        0.97666667 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(12.1129, device='cuda:0') tensor(0.0622, device='cuda:0')\n",
      " tensor(0.0624, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0624, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0624, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0624, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26500\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(11.9812, device='cuda:0') tensor(0.0482, device='cuda:0')\n",
      " tensor(0.0484, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0485, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0486, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0487, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26600\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(12.0930, device='cuda:0') tensor(0.0169, device='cuda:0')\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0162, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0160, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0159, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26700\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(11.8221, device='cuda:0') tensor(0.0468, device='cuda:0')\n",
      " tensor(0.0468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0467, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0467, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26800\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(12.1206, device='cuda:0') tensor(0.0420, device='cuda:0')\n",
      " tensor(0.0419, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0419, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0418, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0418, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 26900\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(11.7689, device='cuda:0') tensor(0.0329, device='cuda:0')\n",
      " tensor(0.0329, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27000\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(11.7185, device='cuda:0') tensor(0.0598, device='cuda:0')\n",
      " tensor(0.0596, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0595, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0595, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0594, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9155 0.916  0.916  0.916  0.916 ]\n",
      "epoch: 27100\n",
      "[0.2        0.98       0.98       0.98       0.98       0.97833333]\n",
      "[tensor(11.7293, device='cuda:0') tensor(0.0715, device='cuda:0')\n",
      " tensor(0.0716, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0718, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0720, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0722, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.7541, device='cuda:0') tensor(0.0355, device='cuda:0')\n",
      " tensor(0.0355, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0355, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0355, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0355, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27300\n",
      "[0.2        0.96666667 0.965      0.965      0.96333333 0.96333333]\n",
      "[tensor(11.6945, device='cuda:0') tensor(0.0837, device='cuda:0')\n",
      " tensor(0.0838, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0839, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0840, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0841, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27400\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(11.6945, device='cuda:0') tensor(0.0564, device='cuda:0')\n",
      " tensor(0.0561, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0558, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0556, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0554, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27500\n",
      "[0.2        0.96666667 0.96666667 0.96666667 0.96666667 0.96666667]\n",
      "[tensor(11.5461, device='cuda:0') tensor(0.0871, device='cuda:0')\n",
      " tensor(0.0871, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0870, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0869, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27600\n",
      "[0.2        0.96166667 0.96166667 0.96166667 0.96166667 0.96166667]\n",
      "[tensor(11.6801, device='cuda:0') tensor(0.1092, device='cuda:0')\n",
      " tensor(0.1088, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1087, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1086, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1086, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27700\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(11.6587, device='cuda:0') tensor(0.0368, device='cuda:0')\n",
      " tensor(0.0368, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0368, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0367, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0367, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27800\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(11.8984, device='cuda:0') tensor(0.0447, device='cuda:0')\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0445, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0445, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0444, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 27900\n",
      "[0.2        0.95333333 0.955      0.95833333 0.95833333 0.95833333]\n",
      "[tensor(11.7411, device='cuda:0') tensor(0.1302, device='cuda:0')\n",
      " tensor(0.1302, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1303, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1304, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1305, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28000\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(11.5597, device='cuda:0') tensor(0.0240, device='cuda:0')\n",
      " tensor(0.0240, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0240, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0239, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0239, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9106 0.9106 0.9106 0.9106 0.9106]\n",
      "epoch: 28100\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(11.8416, device='cuda:0') tensor(0.0300, device='cuda:0')\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28200\n",
      "[0.2  0.95 0.95 0.95 0.95 0.95]\n",
      "[tensor(11.7046, device='cuda:0') tensor(0.1115, device='cuda:0')\n",
      " tensor(0.1111, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1108, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1106, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1104, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28300\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(11.8051, device='cuda:0') tensor(0.0364, device='cuda:0')\n",
      " tensor(0.0363, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0363, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0363, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28400\n",
      "[0.2        0.97333333 0.975      0.975      0.975      0.975     ]\n",
      "[tensor(11.7763, device='cuda:0') tensor(0.0724, device='cuda:0')\n",
      " tensor(0.0722, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0720, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0719, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0718, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28500\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(11.8361, device='cuda:0') tensor(0.0505, device='cuda:0')\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0504, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0504, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 28600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.6413, device='cuda:0') tensor(0.0167, device='cuda:0')\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28700\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(11.6319, device='cuda:0') tensor(0.0288, device='cuda:0')\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28800\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(11.8075, device='cuda:0') tensor(0.0582, device='cuda:0')\n",
      " tensor(0.0579, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0577, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0573, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 28900\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(11.6480, device='cuda:0') tensor(0.0550, device='cuda:0')\n",
      " tensor(0.0550, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0549, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0549, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0548, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29000\n",
      "[0.2        0.95833333 0.96333333 0.96166667 0.96       0.95833333]\n",
      "[tensor(11.5137, device='cuda:0') tensor(0.0980, device='cuda:0')\n",
      " tensor(0.1009, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0996, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0994, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0994, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9106 0.911  0.911  0.911  0.911 ]\n",
      "epoch: 29100\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.6356, device='cuda:0') tensor(0.0361, device='cuda:0')\n",
      " tensor(0.0361, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0361, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0361, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0361, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.8085, device='cuda:0') tensor(0.0416, device='cuda:0')\n",
      " tensor(0.0416, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0416, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0415, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0415, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29300\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(11.8099, device='cuda:0') tensor(0.0316, device='cuda:0')\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29400\n",
      "[0.2   0.965 0.965 0.965 0.965 0.965]\n",
      "[tensor(11.6330, device='cuda:0') tensor(0.0843, device='cuda:0')\n",
      " tensor(0.0841, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0840, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0838, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0837, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29500\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(11.9583, device='cuda:0') tensor(0.0600, device='cuda:0')\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29600\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(11.4948, device='cuda:0') tensor(0.0324, device='cuda:0')\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0323, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0323, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29700\n",
      "[0.2        0.96833333 0.96       0.96       0.96       0.96      ]\n",
      "[tensor(11.5110, device='cuda:0') tensor(0.0920, device='cuda:0')\n",
      " tensor(0.0929, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0937, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0943, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0948, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29800\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(11.4644, device='cuda:0') tensor(0.0357, device='cuda:0')\n",
      " tensor(0.0357, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 29900\n",
      "[0.2        0.97833333 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(11.3184, device='cuda:0') tensor(0.0698, device='cuda:0')\n",
      " tensor(0.0714, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0714, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0713, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0712, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30000\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(11.5608, device='cuda:0') tensor(0.0426, device='cuda:0')\n",
      " tensor(0.0426, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0426, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0426, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0426, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9116 0.9116 0.9116 0.9116 0.9116]\n",
      "epoch: 30100\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(11.2492, device='cuda:0') tensor(0.0768, device='cuda:0')\n",
      " tensor(0.0766, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0764, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0763, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0762, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30200\n",
      "[0.2        0.96833333 0.96833333 0.96833333 0.96833333 0.96833333]\n",
      "[tensor(11.3143, device='cuda:0') tensor(0.0734, device='cuda:0')\n",
      " tensor(0.0735, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0736, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0736, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0737, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30300\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.3605, device='cuda:0') tensor(0.0226, device='cuda:0')\n",
      " tensor(0.0225, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0225, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0224, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0224, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30400\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.2943, device='cuda:0') tensor(0.0281, device='cuda:0')\n",
      " tensor(0.0281, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30500\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.2148, device='cuda:0') tensor(0.0340, device='cuda:0')\n",
      " tensor(0.0340, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0340, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0340, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0340, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30600\n",
      "[0.2        0.97666667 0.98       0.98       0.98       0.98      ]\n",
      "[tensor(11.2286, device='cuda:0') tensor(0.0677, device='cuda:0')\n",
      " tensor(0.0666, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0670, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0674, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0677, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30700\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.3378, device='cuda:0') tensor(0.0436, device='cuda:0')\n",
      " tensor(0.0435, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 30800\n",
      "[0.2        0.94833333 0.94833333 0.94833333 0.95       0.95      ]\n",
      "[tensor(11.2808, device='cuda:0') tensor(0.1401, device='cuda:0')\n",
      " tensor(0.1405, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1409, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1412, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1414, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 30900\n",
      "[0.2        0.95166667 0.95833333 0.95833333 0.96       0.95833333]\n",
      "[tensor(11.3426, device='cuda:0') tensor(0.1134, device='cuda:0')\n",
      " tensor(0.1012, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1010, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1009, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1008, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31000\n",
      "[0.2        0.995      0.995      0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.4197, device='cuda:0') tensor(0.0241, device='cuda:0')\n",
      " tensor(0.0238, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0234, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0232, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.907  0.907  0.907  0.9077 0.9077]\n",
      "epoch: 31100\n",
      "[0.2        0.97       0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(11.5135, device='cuda:0') tensor(0.0936, device='cuda:0')\n",
      " tensor(0.0932, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0929, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0926, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0923, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31200\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(11.2705, device='cuda:0') tensor(0.0228, device='cuda:0')\n",
      " tensor(0.0228, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31300\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(11.3716, device='cuda:0') tensor(0.0384, device='cuda:0')\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0380, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31400\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(11.2341, device='cuda:0') tensor(0.0289, device='cuda:0')\n",
      " tensor(0.0289, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0289, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0289, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0289, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31500\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.3502, device='cuda:0') tensor(0.0388, device='cuda:0')\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0384, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31600\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(11.3984, device='cuda:0') tensor(0.0441, device='cuda:0')\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31700\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.3455, device='cuda:0') tensor(0.0356, device='cuda:0')\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31800\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.9993, device='cuda:0') tensor(0.0190, device='cuda:0')\n",
      " tensor(0.0190, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 31900\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.9323, device='cuda:0') tensor(0.0527, device='cuda:0')\n",
      " tensor(0.0527, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0527, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0527, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0527, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32000\n",
      "[0.2        0.96333333 0.96333333 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(11.1217, device='cuda:0') tensor(0.1075, device='cuda:0')\n",
      " tensor(0.1076, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1077, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1077, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1078, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.911  0.9116 0.9116 0.9116 0.9116]\n",
      "epoch: 32100\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.8766, device='cuda:0') tensor(0.0601, device='cuda:0')\n",
      " tensor(0.0601, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0601, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0602, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0602, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(11.0612, device='cuda:0') tensor(0.0510, device='cuda:0')\n",
      " tensor(0.0510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0509, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0509, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32300\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(11.1778, device='cuda:0') tensor(0.0703, device='cuda:0')\n",
      " tensor(0.0701, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0699, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0697, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0695, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32400\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.0623, device='cuda:0') tensor(0.0245, device='cuda:0')\n",
      " tensor(0.0239, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0235, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32500\n",
      "[0.2        0.97333333 0.97333333 0.975      0.97333333 0.97333333]\n",
      "[tensor(10.9793, device='cuda:0') tensor(0.0630, device='cuda:0')\n",
      " tensor(0.0621, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0614, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0609, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0605, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32600\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.9335, device='cuda:0') tensor(0.0318, device='cuda:0')\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.0321, device='cuda:0') tensor(0.0230, device='cuda:0')\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0231, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0231, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32800\n",
      "[0.2        0.975      0.975      0.975      0.97333333 0.97333333]\n",
      "[tensor(11.0240, device='cuda:0') tensor(0.0678, device='cuda:0')\n",
      " tensor(0.0729, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0760, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0784, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0803, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 32900\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(11.1442, device='cuda:0') tensor(0.0422, device='cuda:0')\n",
      " tensor(0.0422, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0422, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0422, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0422, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 33000\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(11.0004, device='cuda:0') tensor(0.0399, device='cuda:0')\n",
      " tensor(0.0399, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0399, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0399, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0399, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9146 0.9146 0.9146 0.9146 0.9146]\n",
      "epoch: 33100\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.8873, device='cuda:0') tensor(0.0388, device='cuda:0')\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0385, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0383, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33200\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.9201, device='cuda:0') tensor(0.0582, device='cuda:0')\n",
      " tensor(0.0579, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0577, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0576, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33300\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.8817, device='cuda:0') tensor(0.0666, device='cuda:0')\n",
      " tensor(0.0666, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0665, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0665, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0665, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33400\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(11.0591, device='cuda:0') tensor(0.0234, device='cuda:0')\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33500\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.8921, device='cuda:0') tensor(0.0513, device='cuda:0')\n",
      " tensor(0.0512, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0512, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0511, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0511, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33600\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.8999, device='cuda:0') tensor(0.0412, device='cuda:0')\n",
      " tensor(0.0412, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0412, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0412, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0412, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33700\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(10.9328, device='cuda:0') tensor(0.0753, device='cuda:0')\n",
      " tensor(0.0753, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0753, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0753, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0753, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33800\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(10.8328, device='cuda:0') tensor(0.0713, device='cuda:0')\n",
      " tensor(0.0713, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0712, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0712, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0712, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 33900\n",
      "[0.2  0.97 0.97 0.97 0.97 0.97]\n",
      "[tensor(10.7438, device='cuda:0') tensor(0.0803, device='cuda:0')\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0802, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34000\n",
      "[0.2        0.98666667 0.98666667 0.985      0.985      0.985     ]\n",
      "[tensor(10.8976, device='cuda:0') tensor(0.0367, device='cuda:0')\n",
      " tensor(0.0366, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0365, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0364, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0364, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9146 0.9146 0.915  0.915  0.915 ]\n",
      "epoch: 34100\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(10.9598, device='cuda:0') tensor(0.0885, device='cuda:0')\n",
      " tensor(0.0885, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0885, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0886, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0886, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34200\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(10.9578, device='cuda:0') tensor(0.0762, device='cuda:0')\n",
      " tensor(0.0761, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0761, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0760, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0760, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34300\n",
      "[0.2        0.97666667 0.97666667 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.7009, device='cuda:0') tensor(0.0709, device='cuda:0')\n",
      " tensor(0.0698, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0694, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0691, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0689, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34400\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.8915, device='cuda:0') tensor(0.0293, device='cuda:0')\n",
      " tensor(0.0293, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0293, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0293, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0293, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34500\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.8810, device='cuda:0') tensor(0.0383, device='cuda:0')\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34600\n",
      "[0.2  0.96 0.96 0.96 0.96 0.96]\n",
      "[tensor(10.7268, device='cuda:0') tensor(0.0723, device='cuda:0')\n",
      " tensor(0.0740, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0752, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0761, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0768, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34700\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.9722, device='cuda:0') tensor(0.0410, device='cuda:0')\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34800\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(11.0480, device='cuda:0') tensor(0.0520, device='cuda:0')\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0518, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 34900\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(11.0689, device='cuda:0') tensor(0.0786, device='cuda:0')\n",
      " tensor(0.0786, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0786, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0786, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0786, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35000\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.8669, device='cuda:0') tensor(0.0500, device='cuda:0')\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0499, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0498, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9097 0.91   0.91   0.91   0.91  ]\n",
      "epoch: 35100\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.8425, device='cuda:0') tensor(0.0478, device='cuda:0')\n",
      " tensor(0.0478, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0478, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0478, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0478, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 35200\n",
      "[0.2        0.97166667 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(10.9226, device='cuda:0') tensor(0.0611, device='cuda:0')\n",
      " tensor(0.0593, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0583, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0575, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0569, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35300\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.99       0.99      ]\n",
      "[tensor(10.6746, device='cuda:0') tensor(0.0284, device='cuda:0')\n",
      " tensor(0.0281, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0279, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0278, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0276, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35400\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.8481, device='cuda:0') tensor(0.0325, device='cuda:0')\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0323, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0323, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35500\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(11.0600, device='cuda:0') tensor(0.0536, device='cuda:0')\n",
      " tensor(0.0538, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0540, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0541, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0543, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.8659, device='cuda:0') tensor(0.0200, device='cuda:0')\n",
      " tensor(0.0200, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0199, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0199, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0199, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35700\n",
      "[0.2        0.97333333 0.975      0.975      0.975      0.975     ]\n",
      "[tensor(10.7670, device='cuda:0') tensor(0.0537, device='cuda:0')\n",
      " tensor(0.0563, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0570, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0576, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0581, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35800\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.8365, device='cuda:0') tensor(0.0519, device='cuda:0')\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 35900\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.8415, device='cuda:0') tensor(0.0330, device='cuda:0')\n",
      " tensor(0.0330, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0329, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0329, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0329, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36000\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(11.0761, device='cuda:0') tensor(0.0452, device='cuda:0')\n",
      " tensor(0.0452, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0452, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0452, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0452, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.91   0.91   0.9106 0.9106 0.91  ]\n",
      "epoch: 36100\n",
      "[0.2  0.97 0.97 0.97 0.97 0.97]\n",
      "[tensor(10.7461, device='cuda:0') tensor(0.0685, device='cuda:0')\n",
      " tensor(0.0687, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0689, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0692, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0693, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36200\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.6587, device='cuda:0') tensor(0.0585, device='cuda:0')\n",
      " tensor(0.0585, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0585, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0585, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0585, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36300\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.8912, device='cuda:0') tensor(0.0600, device='cuda:0')\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36400\n",
      "[0.2        0.99       0.99       0.99       0.98833333 0.98666667]\n",
      "[tensor(10.7404, device='cuda:0') tensor(0.0324, device='cuda:0')\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0326, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0327, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36500\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.5279, device='cuda:0') tensor(0.0188, device='cuda:0')\n",
      " tensor(0.0187, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0187, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0187, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0187, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.5491, device='cuda:0') tensor(0.0322, device='cuda:0')\n",
      " tensor(0.0321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0320, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0320, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.8214, device='cuda:0') tensor(0.0301, device='cuda:0')\n",
      " tensor(0.0301, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0301, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36800\n",
      "[0.2        0.98166667 0.98333333 0.985      0.985      0.985     ]\n",
      "[tensor(10.6831, device='cuda:0') tensor(0.0564, device='cuda:0')\n",
      " tensor(0.0563, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0563, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0562, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0561, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 36900\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.9459, device='cuda:0') tensor(0.0605, device='cuda:0')\n",
      " tensor(0.0602, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0597, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0595, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37000\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.7349, device='cuda:0') tensor(0.0352, device='cuda:0')\n",
      " tensor(0.0350, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0348, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0346, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0344, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.917  0.9175 0.9175 0.9175 0.9175]\n",
      "epoch: 37100\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.6087, device='cuda:0') tensor(0.0496, device='cuda:0')\n",
      " tensor(0.0553, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0553, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0553, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0552, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.7449, device='cuda:0') tensor(0.0300, device='cuda:0')\n",
      " tensor(0.0299, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0298, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0298, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0297, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37300\n",
      "[0.2        0.96333333 0.96333333 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(10.6174, device='cuda:0') tensor(0.1107, device='cuda:0')\n",
      " tensor(0.1108, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1109, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1109, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1110, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 37400\n",
      "[0.2        0.975      0.97166667 0.97       0.97       0.97      ]\n",
      "[tensor(10.7175, device='cuda:0') tensor(0.0919, device='cuda:0')\n",
      " tensor(0.0907, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0903, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0900, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0898, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37500\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.7206, device='cuda:0') tensor(0.0325, device='cuda:0')\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37600\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.5883, device='cuda:0') tensor(0.0647, device='cuda:0')\n",
      " tensor(0.0632, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0623, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0617, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0613, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37700\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.5154, device='cuda:0') tensor(0.0384, device='cuda:0')\n",
      " tensor(0.0383, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0383, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37800\n",
      "[0.2        0.96666667 0.965      0.965      0.965      0.965     ]\n",
      "[tensor(10.5687, device='cuda:0') tensor(0.0806, device='cuda:0')\n",
      " tensor(0.0806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0806, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0805, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 37900\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.7180, device='cuda:0') tensor(0.0715, device='cuda:0')\n",
      " tensor(0.0715, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0715, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0715, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0715, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38000\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(11.0688, device='cuda:0') tensor(0.0230, device='cuda:0')\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0230, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.913 0.913 0.913 0.913 0.913]\n",
      "epoch: 38100\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.8904, device='cuda:0') tensor(0.0560, device='cuda:0')\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38200\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.7075, device='cuda:0') tensor(0.0260, device='cuda:0')\n",
      " tensor(0.0260, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0260, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0260, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0260, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38300\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(11.0680, device='cuda:0') tensor(0.0102, device='cuda:0')\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38400\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.6439, device='cuda:0') tensor(0.0139, device='cuda:0')\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38500\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.7150, device='cuda:0') tensor(0.0365, device='cuda:0')\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0360, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0356, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38600\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.7659, device='cuda:0') tensor(0.0445, device='cuda:0')\n",
      " tensor(0.0438, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0431, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0428, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38700\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.5122, device='cuda:0') tensor(0.0295, device='cuda:0')\n",
      " tensor(0.0295, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0295, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0295, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0295, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38800\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.7650, device='cuda:0') tensor(0.0170, device='cuda:0')\n",
      " tensor(0.0169, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0168, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0168, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0167, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 38900\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.8667, device='cuda:0') tensor(0.0333, device='cuda:0')\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39000\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.7780, device='cuda:0') tensor(0.0383, device='cuda:0')\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0382, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9165 0.9165 0.917  0.917  0.917 ]\n",
      "epoch: 39100\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.8153, device='cuda:0') tensor(0.0411, device='cuda:0')\n",
      " tensor(0.0411, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0411, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0411, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0411, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39200\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.6729, device='cuda:0') tensor(0.0171, device='cuda:0')\n",
      " tensor(0.0171, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0171, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0171, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0171, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39300\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(10.8288, device='cuda:0') tensor(0.0672, device='cuda:0')\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39400\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(10.7637, device='cuda:0') tensor(0.0677, device='cuda:0')\n",
      " tensor(0.0662, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0656, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0652, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0649, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39500\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.7524, device='cuda:0') tensor(0.0472, device='cuda:0')\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 39600\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.5516, device='cuda:0') tensor(0.0673, device='cuda:0')\n",
      " tensor(0.0673, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0673, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39700\n",
      "[0.2        0.98666667 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.4273, device='cuda:0') tensor(0.0371, device='cuda:0')\n",
      " tensor(0.0369, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0368, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0367, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0366, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39800\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.5397, device='cuda:0') tensor(0.0198, device='cuda:0')\n",
      " tensor(0.0198, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0198, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0197, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0197, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 39900\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.4840, device='cuda:0') tensor(0.0302, device='cuda:0')\n",
      " tensor(0.0301, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0300, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0299, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0298, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40000\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.6077, device='cuda:0') tensor(0.0434, device='cuda:0')\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9146 0.9146 0.9146 0.9146 0.9146]\n",
      "epoch: 40100\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.8262, device='cuda:0') tensor(0.0135, device='cuda:0')\n",
      " tensor(0.0134, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0134, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0133, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0133, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40200\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(10.6953, device='cuda:0') tensor(0.1038, device='cuda:0')\n",
      " tensor(0.1041, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1043, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1046, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1048, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40300\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.6188, device='cuda:0') tensor(0.0351, device='cuda:0')\n",
      " tensor(0.0351, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0352, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0352, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0352, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40400\n",
      "[0.2        0.96166667 0.96333333 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(10.4793, device='cuda:0') tensor(0.0879, device='cuda:0')\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0860, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0854, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0850, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40500\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.5134, device='cuda:0') tensor(0.0319, device='cuda:0')\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40600\n",
      "[0.2        0.96833333 0.96166667 0.96666667 0.97666667 0.975     ]\n",
      "[tensor(10.5123, device='cuda:0') tensor(0.0688, device='cuda:0')\n",
      " tensor(0.0852, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0678, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0661, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0660, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.6105, device='cuda:0') tensor(0.0259, device='cuda:0')\n",
      " tensor(0.0259, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0259, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0259, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0259, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40800\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.5002, device='cuda:0') tensor(0.0251, device='cuda:0')\n",
      " tensor(0.0249, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0246, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 40900\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.8303, device='cuda:0') tensor(0.0450, device='cuda:0')\n",
      " tensor(0.0450, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0450, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0450, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0450, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41000\n",
      "[0.2        0.96333333 0.96333333 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(10.7364, device='cuda:0') tensor(0.0890, device='cuda:0')\n",
      " tensor(0.0889, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0888, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0888, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0887, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9146 0.914  0.914  0.914  0.914 ]\n",
      "epoch: 41100\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.4992, device='cuda:0') tensor(0.0385, device='cuda:0')\n",
      " tensor(0.0385, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0384, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0384, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0384, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41200\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.3418, device='cuda:0') tensor(0.0759, device='cuda:0')\n",
      " tensor(0.0759, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0759, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0760, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0760, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41300\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.4279, device='cuda:0') tensor(0.0402, device='cuda:0')\n",
      " tensor(0.0401, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0401, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0401, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0401, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41400\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.7489, device='cuda:0') tensor(0.0145, device='cuda:0')\n",
      " tensor(0.0145, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0144, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0144, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0144, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41500\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.4931, device='cuda:0') tensor(0.0444, device='cuda:0')\n",
      " tensor(0.0444, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0445, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0445, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41600\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.5598, device='cuda:0') tensor(0.0284, device='cuda:0')\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41700\n",
      "[0.2        0.96333333 0.96333333 0.96333333 0.96333333 0.96333333]\n",
      "[tensor(10.4849, device='cuda:0') tensor(0.1123, device='cuda:0')\n",
      " tensor(0.1122, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1122, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1122, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1122, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 41800\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.2476, device='cuda:0') tensor(0.0409, device='cuda:0')\n",
      " tensor(0.0405, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0402, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0400, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0398, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 41900\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.5225, device='cuda:0') tensor(0.0110, device='cuda:0')\n",
      " tensor(0.0110, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0110, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0110, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0110, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42000\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.5244, device='cuda:0') tensor(0.0269, device='cuda:0')\n",
      " tensor(0.0269, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0269, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0269, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0269, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.918 0.918 0.918 0.918 0.918]\n",
      "epoch: 42100\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.4798, device='cuda:0') tensor(0.0276, device='cuda:0')\n",
      " tensor(0.0275, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0274, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0274, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0273, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42200\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.6384, device='cuda:0') tensor(0.0334, device='cuda:0')\n",
      " tensor(0.0334, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0334, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0334, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0334, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42300\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.6330, device='cuda:0') tensor(0.0371, device='cuda:0')\n",
      " tensor(0.0371, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0371, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0371, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0371, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42400\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.3768, device='cuda:0') tensor(0.0410, device='cuda:0')\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42500\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.4559, device='cuda:0') tensor(0.0217, device='cuda:0')\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42600\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.3523, device='cuda:0') tensor(0.0100, device='cuda:0')\n",
      " tensor(0.0100, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0099, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0099, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0098, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.2187, device='cuda:0') tensor(0.0155, device='cuda:0')\n",
      " tensor(0.0155, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0155, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0155, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0155, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42800\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98833333]\n",
      "[tensor(10.3255, device='cuda:0') tensor(0.0254, device='cuda:0')\n",
      " tensor(0.0253, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0253, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0253, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0253, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 42900\n",
      "[0.2        0.98166667 0.98166667 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.5675, device='cuda:0') tensor(0.0444, device='cuda:0')\n",
      " tensor(0.0443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0443, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0443, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43000\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.98       0.98      ]\n",
      "[tensor(10.4336, device='cuda:0') tensor(0.0439, device='cuda:0')\n",
      " tensor(0.0436, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0434, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0432, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0430, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9175 0.9175 0.9175 0.9175 0.9175]\n",
      "epoch: 43100\n",
      "[0.2        0.97166667 0.97333333 0.975      0.98       0.98      ]\n",
      "[tensor(10.4622, device='cuda:0') tensor(0.0643, device='cuda:0')\n",
      " tensor(0.0604, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0589, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0579, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0572, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43200\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.2304, device='cuda:0') tensor(0.0365, device='cuda:0')\n",
      " tensor(0.0365, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0365, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0365, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0365, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43300\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.2966, device='cuda:0') tensor(0.0227, device='cuda:0')\n",
      " tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0226, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0226, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0225, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43400\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.3984, device='cuda:0') tensor(0.0327, device='cuda:0')\n",
      " tensor(0.0327, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0327, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0327, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0327, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43500\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2103, device='cuda:0') tensor(0.0093, device='cuda:0')\n",
      " tensor(0.0093, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0093, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0093, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0093, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.2530, device='cuda:0') tensor(0.0184, device='cuda:0')\n",
      " tensor(0.0183, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0183, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0183, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0182, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43700\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.3315, device='cuda:0') tensor(0.0265, device='cuda:0')\n",
      " tensor(0.0265, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0265, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0265, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0265, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43800\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.2772, device='cuda:0') tensor(0.0386, device='cuda:0')\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0386, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 43900\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.3287, device='cuda:0') tensor(0.0704, device='cuda:0')\n",
      " tensor(0.0704, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0704, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0704, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0704, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 44000\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(10.2991, device='cuda:0') tensor(0.0471, device='cuda:0')\n",
      " tensor(0.0470, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0469, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0467, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.916 0.916 0.916 0.916 0.916]\n",
      "epoch: 44100\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.5136, device='cuda:0') tensor(0.0136, device='cuda:0')\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44200\n",
      "[0.2        0.98       0.98       0.98       0.98       0.97833333]\n",
      "[tensor(10.1900, device='cuda:0') tensor(0.0582, device='cuda:0')\n",
      " tensor(0.0582, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0582, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0582, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0581, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44300\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.1093, device='cuda:0') tensor(0.0331, device='cuda:0')\n",
      " tensor(0.0331, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0331, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0331, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0331, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44400\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(10.1556, device='cuda:0') tensor(0.0869, device='cuda:0')\n",
      " tensor(0.0869, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0868, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44500\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.2972, device='cuda:0') tensor(0.0058, device='cuda:0')\n",
      " tensor(0.0058, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0058, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0058, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0058, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44600\n",
      "[0.2        0.98166667 0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.2493, device='cuda:0') tensor(0.0408, device='cuda:0')\n",
      " tensor(0.0408, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0408, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0408, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0408, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44700\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.3682, device='cuda:0') tensor(0.0471, device='cuda:0')\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0471, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44800\n",
      "[0.2        0.97333333 0.97333333 0.975      0.975      0.975     ]\n",
      "[tensor(10.3398, device='cuda:0') tensor(0.0596, device='cuda:0')\n",
      " tensor(0.0581, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0574, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0571, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0568, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 44900\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.2740, device='cuda:0') tensor(0.0560, device='cuda:0')\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0560, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45000\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.2067, device='cuda:0') tensor(0.0362, device='cuda:0')\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0362, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9175 0.9175 0.9175 0.9175 0.9175]\n",
      "epoch: 45100\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.2465, device='cuda:0') tensor(0.0233, device='cuda:0')\n",
      " tensor(0.0233, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0232, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0232, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0232, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45200\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.0363, device='cuda:0') tensor(0.0510, device='cuda:0')\n",
      " tensor(0.0510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0510, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0509, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0509, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45300\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.1115, device='cuda:0') tensor(0.0404, device='cuda:0')\n",
      " tensor(0.0402, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0400, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0398, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0396, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45400\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.1145, device='cuda:0') tensor(0.0121, device='cuda:0')\n",
      " tensor(0.0121, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0121, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0121, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0121, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45500\n",
      "[0.2        0.98333333 0.98333333 0.985      0.985      0.985     ]\n",
      "[tensor(10.3239, device='cuda:0') tensor(0.0554, device='cuda:0')\n",
      " tensor(0.0553, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0552, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0552, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0551, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45600\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.3731, device='cuda:0') tensor(0.0603, device='cuda:0')\n",
      " tensor(0.0603, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0603, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0603, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0603, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45700\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.2880, device='cuda:0') tensor(0.0505, device='cuda:0')\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0505, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45800\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.1928, device='cuda:0') tensor(0.0135, device='cuda:0')\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 45900\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2583, device='cuda:0') tensor(0.0206, device='cuda:0')\n",
      " tensor(0.0206, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0206, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0206, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0206, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46000\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.0260, device='cuda:0') tensor(0.0513, device='cuda:0')\n",
      " tensor(0.0513, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0513, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0513, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0512, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9126 0.9126 0.9126 0.9126 0.9126]\n",
      "epoch: 46100\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.0831, device='cuda:0') tensor(0.0268, device='cuda:0')\n",
      " tensor(0.0268, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0268, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0268, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0268, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 46200\n",
      "[0.2        0.99166667 0.99166667 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.2484, device='cuda:0') tensor(0.0248, device='cuda:0')\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46300\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.3037, device='cuda:0') tensor(0.0258, device='cuda:0')\n",
      " tensor(0.0258, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0258, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0258, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0258, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46400\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.1081, device='cuda:0') tensor(0.0473, device='cuda:0')\n",
      " tensor(0.0464, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0458, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0453, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0449, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46500\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.0961, device='cuda:0') tensor(0.0167, device='cuda:0')\n",
      " tensor(0.0167, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0167, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0167, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0167, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46600\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.1273, device='cuda:0') tensor(0.0452, device='cuda:0')\n",
      " tensor(0.0452, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0451, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0451, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0451, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46700\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.1455, device='cuda:0') tensor(0.0557, device='cuda:0')\n",
      " tensor(0.0557, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0557, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0557, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0556, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46800\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.1914, device='cuda:0') tensor(0.0339, device='cuda:0')\n",
      " tensor(0.0339, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0338, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0338, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0338, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 46900\n",
      "[0.2   0.945 0.945 0.945 0.945 0.945]\n",
      "[tensor(10.2305, device='cuda:0') tensor(0.1548, device='cuda:0')\n",
      " tensor(0.1548, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1548, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1548, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1547, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47000\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.0535, device='cuda:0') tensor(0.0612, device='cuda:0')\n",
      " tensor(0.0612, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0612, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0612, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0612, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9175 0.9175 0.918  0.918  0.918 ]\n",
      "epoch: 47100\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2058, device='cuda:0') tensor(0.0152, device='cuda:0')\n",
      " tensor(0.0151, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0151, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0150, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0150, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47200\n",
      "[0.2        0.95833333 0.95833333 0.95833333 0.95833333 0.95833333]\n",
      "[tensor(10.2627, device='cuda:0') tensor(0.1130, device='cuda:0')\n",
      " tensor(0.1131, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1133, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1134, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.1135, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47300\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.3132, device='cuda:0') tensor(0.0219, device='cuda:0')\n",
      " tensor(0.0219, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0219, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0219, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0219, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47400\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.2660, device='cuda:0') tensor(0.0338, device='cuda:0')\n",
      " tensor(0.0338, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0337, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0337, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0336, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47500\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.2638, device='cuda:0') tensor(0.0280, device='cuda:0')\n",
      " tensor(0.0279, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0279, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0279, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0279, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47600\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.1643, device='cuda:0') tensor(0.0239, device='cuda:0')\n",
      " tensor(0.0239, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0238, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0238, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0238, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47700\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2648, device='cuda:0') tensor(0.0112, device='cuda:0')\n",
      " tensor(0.0112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0112, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0112, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47800\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.1890, device='cuda:0') tensor(0.0476, device='cuda:0')\n",
      " tensor(0.0475, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0475, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0475, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0474, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 47900\n",
      "[0.2        0.98333333 0.985      0.985      0.985      0.985     ]\n",
      "[tensor(10.1865, device='cuda:0') tensor(0.0436, device='cuda:0')\n",
      " tensor(0.0437, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0439, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0441, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48000\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.3429, device='cuda:0') tensor(0.0646, device='cuda:0')\n",
      " tensor(0.0646, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0646, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0646, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0646, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9146 0.914  0.914  0.914  0.914 ]\n",
      "epoch: 48100\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.2088, device='cuda:0') tensor(0.0195, device='cuda:0')\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0194, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0194, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48200\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.1271, device='cuda:0') tensor(0.0519, device='cuda:0')\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0519, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48300\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.1432, device='cuda:0') tensor(0.0175, device='cuda:0')\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48400\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.2231, device='cuda:0') tensor(0.0333, device='cuda:0')\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0333, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0332, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0332, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 48500\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.1436, device='cuda:0') tensor(0.0139, device='cuda:0')\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0139, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48600\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(9.9440, device='cuda:0') tensor(0.0584, device='cuda:0')\n",
      " tensor(0.0584, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0583, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0583, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0582, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48700\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.2235, device='cuda:0') tensor(0.0285, device='cuda:0')\n",
      " tensor(0.0285, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0284, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48800\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(9.9820, device='cuda:0') tensor(0.0130, device='cuda:0')\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 48900\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.2318, device='cuda:0') tensor(0.0280, device='cuda:0')\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0280, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49000\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.995      0.995     ]\n",
      "[tensor(10.3332, device='cuda:0') tensor(0.0315, device='cuda:0')\n",
      " tensor(0.0313, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0311, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0309, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0307, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.919 0.919 0.919 0.919 0.919]\n",
      "epoch: 49100\n",
      "[0.2        0.995      0.995      0.995      0.99333333 0.99333333]\n",
      "[tensor(10.2154, device='cuda:0') tensor(0.0251, device='cuda:0')\n",
      " tensor(0.0250, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49200\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.1232, device='cuda:0') tensor(0.0123, device='cuda:0')\n",
      " tensor(0.0123, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0123, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0123, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0123, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49300\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(9.9897, device='cuda:0') tensor(0.0358, device='cuda:0')\n",
      " tensor(0.0358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0358, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0358, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49400\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.2197, device='cuda:0') tensor(0.0227, device='cuda:0')\n",
      " tensor(0.0227, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0226, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0226, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0226, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49500\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.1218, device='cuda:0') tensor(0.0393, device='cuda:0')\n",
      " tensor(0.0393, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0392, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0392, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49600\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.1922, device='cuda:0') tensor(0.0385, device='cuda:0')\n",
      " tensor(0.0385, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0384, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0383, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0383, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49700\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0114, device='cuda:0') tensor(0.0136, device='cuda:0')\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49800\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.0981, device='cuda:0') tensor(0.0158, device='cuda:0')\n",
      " tensor(0.0158, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0158, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0158, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0158, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 49900\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.0818, device='cuda:0') tensor(0.0319, device='cuda:0')\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50000\n",
      "[0.2  0.96 0.96 0.96 0.96 0.96]\n",
      "[tensor(10.0268, device='cuda:0') tensor(0.0869, device='cuda:0')\n",
      " tensor(0.0874, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0878, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0881, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0883, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9204 0.921  0.921  0.921  0.921 ]\n",
      "epoch: 50100\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.995      0.995     ]\n",
      "[tensor(10.0765, device='cuda:0') tensor(0.0136, device='cuda:0')\n",
      " tensor(0.0136, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0135, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0134, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50200\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1557, device='cuda:0') tensor(0.0129, device='cuda:0')\n",
      " tensor(0.0129, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0129, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0129, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0129, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50300\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.2543, device='cuda:0') tensor(0.0316, device='cuda:0')\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0316, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50400\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(9.8254, device='cuda:0') tensor(0.0144, device='cuda:0')\n",
      " tensor(0.0143, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0143, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0143, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0143, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50500\n",
      "[0.2        0.97666667 0.975      0.975      0.975      0.975     ]\n",
      "[tensor(9.8875, device='cuda:0') tensor(0.0553, device='cuda:0')\n",
      " tensor(0.0554, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0559, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0563, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0566, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50600\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.0793, device='cuda:0') tensor(0.0444, device='cuda:0')\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0441, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0440, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 50700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(9.9677, device='cuda:0') tensor(0.0186, device='cuda:0')\n",
      " tensor(0.0186, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0186, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0186, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0186, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50800\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.0960, device='cuda:0') tensor(0.0973, device='cuda:0')\n",
      " tensor(0.0973, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0973, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0973, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0973, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 50900\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.0286, device='cuda:0') tensor(0.0214, device='cuda:0')\n",
      " tensor(0.0214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0214, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0214, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51000\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.0659, device='cuda:0') tensor(0.0215, device='cuda:0')\n",
      " tensor(0.0215, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0215, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0215, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0214, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.915  0.915  0.915  0.9155 0.9155]\n",
      "epoch: 51100\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(10.0688, device='cuda:0') tensor(0.0692, device='cuda:0')\n",
      " tensor(0.0691, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0691, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0690, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0690, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51200\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1371, device='cuda:0') tensor(0.0181, device='cuda:0')\n",
      " tensor(0.0180, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0180, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0180, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0180, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51300\n",
      "[0.2        0.97666667 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.4593, device='cuda:0') tensor(0.0706, device='cuda:0')\n",
      " tensor(0.0703, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0700, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0699, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0697, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51400\n",
      "[0.2        0.97333333 0.96833333 0.96833333 0.96833333 0.96833333]\n",
      "[tensor(10.3386, device='cuda:0') tensor(0.0648, device='cuda:0')\n",
      " tensor(0.0645, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0646, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0647, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0648, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51500\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.4807, device='cuda:0') tensor(0.0237, device='cuda:0')\n",
      " tensor(0.0237, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0237, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0237, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0237, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.2896, device='cuda:0') tensor(0.0164, device='cuda:0')\n",
      " tensor(0.0164, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51700\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.2068, device='cuda:0') tensor(0.0671, device='cuda:0')\n",
      " tensor(0.0671, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0671, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0671, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0671, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51800\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0959, device='cuda:0') tensor(0.0191, device='cuda:0')\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 51900\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.2079, device='cuda:0') tensor(0.0540, device='cuda:0')\n",
      " tensor(0.0540, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0541, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0541, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0542, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52000\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.1329, device='cuda:0') tensor(0.0469, device='cuda:0')\n",
      " tensor(0.0469, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0469, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0468, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0468, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9185 0.9185 0.9185 0.9185 0.9185]\n",
      "epoch: 52100\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.0237, device='cuda:0') tensor(0.0195, device='cuda:0')\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0195, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52200\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.1259, device='cuda:0') tensor(0.0382, device='cuda:0')\n",
      " tensor(0.0381, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0380, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0379, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52300\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1324, device='cuda:0') tensor(0.0247, device='cuda:0')\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0246, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0246, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0246, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52400\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.2892, device='cuda:0') tensor(0.0211, device='cuda:0')\n",
      " tensor(0.0211, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0211, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0211, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0211, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52500\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.2167, device='cuda:0') tensor(0.0442, device='cuda:0')\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0442, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52600\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.1498, device='cuda:0') tensor(0.0223, device='cuda:0')\n",
      " tensor(0.0222, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0222, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0222, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0222, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52700\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.0770, device='cuda:0') tensor(0.0377, device='cuda:0')\n",
      " tensor(0.0377, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0376, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0376, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0376, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52800\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.0029, device='cuda:0') tensor(0.0216, device='cuda:0')\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0216, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 52900\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0909, device='cuda:0') tensor(0.0083, device='cuda:0')\n",
      " tensor(0.0082, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0082, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0082, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0082, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 53000\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.0213, device='cuda:0') tensor(0.0140, device='cuda:0')\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0142, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0143, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.919  0.9194 0.9194 0.9194 0.9194]\n",
      "epoch: 53100\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(9.9904, device='cuda:0') tensor(0.0055, device='cuda:0')\n",
      " tensor(0.0055, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0055, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0055, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0055, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53200\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0705, device='cuda:0') tensor(0.0091, device='cuda:0')\n",
      " tensor(0.0091, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0091, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0091, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0091, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53300\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1767, device='cuda:0') tensor(0.0288, device='cuda:0')\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0288, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53400\n",
      "[0.2        0.96166667 0.96       0.96       0.96       0.96      ]\n",
      "[tensor(10.4416, device='cuda:0') tensor(0.0949, device='cuda:0')\n",
      " tensor(0.0948, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0948, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0948, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0948, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53500\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.0748, device='cuda:0') tensor(0.0397, device='cuda:0')\n",
      " tensor(0.0397, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0397, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0397, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0397, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53600\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.2772, device='cuda:0') tensor(0.0237, device='cuda:0')\n",
      " tensor(0.0237, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53700\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.0985, device='cuda:0') tensor(0.0446, device='cuda:0')\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0446, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53800\n",
      "[0.2        0.97       0.97       0.97166667 0.97166667 0.97166667]\n",
      "[tensor(10.1868, device='cuda:0') tensor(0.0887, device='cuda:0')\n",
      " tensor(0.0883, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0880, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0877, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0876, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 53900\n",
      "[0.2        0.985      0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.2895, device='cuda:0') tensor(0.0435, device='cuda:0')\n",
      " tensor(0.0424, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0418, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0414, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0411, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54000\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.1390, device='cuda:0') tensor(0.0245, device='cuda:0')\n",
      " tensor(0.0245, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0245, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0245, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0245, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2   0.915 0.915 0.915 0.915 0.915]\n",
      "epoch: 54100\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2978, device='cuda:0') tensor(0.0130, device='cuda:0')\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0130, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54200\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.1069, device='cuda:0') tensor(0.0092, device='cuda:0')\n",
      " tensor(0.0092, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0092, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0092, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0092, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54300\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.1046, device='cuda:0') tensor(0.0310, device='cuda:0')\n",
      " tensor(0.0310, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0310, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0310, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0310, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54400\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.0438, device='cuda:0') tensor(0.0185, device='cuda:0')\n",
      " tensor(0.0185, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0185, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0185, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0185, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54500\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.1192, device='cuda:0') tensor(0.0377, device='cuda:0')\n",
      " tensor(0.0377, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0377, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0377, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0377, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54600\n",
      "[0.2        0.98333333 0.98333333 0.98333333 0.98333333 0.98333333]\n",
      "[tensor(10.1688, device='cuda:0') tensor(0.0601, device='cuda:0')\n",
      " tensor(0.0600, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0600, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0598, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54700\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.2071, device='cuda:0') tensor(0.0217, device='cuda:0')\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0217, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54800\n",
      "[0.2        0.97833333 0.97833333 0.97833333 0.97833333 0.97833333]\n",
      "[tensor(10.3287, device='cuda:0') tensor(0.0600, device='cuda:0')\n",
      " tensor(0.0599, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0600, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0600, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0600, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 54900\n",
      "[0.2  0.98 0.98 0.98 0.98 0.98]\n",
      "[tensor(10.0542, device='cuda:0') tensor(0.0546, device='cuda:0')\n",
      " tensor(0.0547, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0547, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0547, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0548, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55000\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.1391, device='cuda:0') tensor(0.0341, device='cuda:0')\n",
      " tensor(0.0341, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0341, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0341, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0341, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9155 0.9155 0.9155 0.9155 0.9155]\n",
      "epoch: 55100\n",
      "[0.2        0.97833333 0.98       0.98       0.98       0.98      ]\n",
      "[tensor(10.3524, device='cuda:0') tensor(0.0479, device='cuda:0')\n",
      " tensor(0.0485, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0483, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0482, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0481, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 55200\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2133, device='cuda:0') tensor(0.0062, device='cuda:0')\n",
      " tensor(0.0062, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0062, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0062, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0062, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55300\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.2065, device='cuda:0') tensor(0.0116, device='cuda:0')\n",
      " tensor(0.0116, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0116, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0116, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0116, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55400\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.2829, device='cuda:0') tensor(0.0246, device='cuda:0')\n",
      " tensor(0.0243, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0241, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0239, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0238, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55500\n",
      "[0.2        0.98833333 0.99       0.99       0.99       0.99      ]\n",
      "[tensor(10.2298, device='cuda:0') tensor(0.0321, device='cuda:0')\n",
      " tensor(0.0318, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0315, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0313, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0312, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55600\n",
      "[0.2        0.97333333 0.97333333 0.97333333 0.97333333 0.97333333]\n",
      "[tensor(10.3383, device='cuda:0') tensor(0.0797, device='cuda:0')\n",
      " tensor(0.0797, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0797, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0798, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0798, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55700\n",
      "[0.2   0.975 0.975 0.975 0.975 0.975]\n",
      "[tensor(9.9922, device='cuda:0') tensor(0.0552, device='cuda:0')\n",
      " tensor(0.0551, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0551, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0550, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0550, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55800\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0758, device='cuda:0') tensor(0.0127, device='cuda:0')\n",
      " tensor(0.0127, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0127, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 55900\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.3556, device='cuda:0') tensor(0.0094, device='cuda:0')\n",
      " tensor(0.0094, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0094, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0094, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0094, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56000\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(10.0563, device='cuda:0') tensor(0.0410, device='cuda:0')\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0410, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9185 0.9185 0.9185 0.9185 0.9185]\n",
      "epoch: 56100\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.2802, device='cuda:0') tensor(0.0128, device='cuda:0')\n",
      " tensor(0.0128, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0128, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0128, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0128, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56200\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.2035, device='cuda:0') tensor(0.0098, device='cuda:0')\n",
      " tensor(0.0098, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0098, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0098, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0098, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56300\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.0057, device='cuda:0') tensor(0.0126, device='cuda:0')\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0126, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56400\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.2313, device='cuda:0') tensor(0.0250, device='cuda:0')\n",
      " tensor(0.0248, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0247, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0246, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56500\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(9.6942, device='cuda:0') tensor(0.0325, device='cuda:0')\n",
      " tensor(0.0325, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0324, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0323, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56600\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.0083, device='cuda:0') tensor(0.0420, device='cuda:0')\n",
      " tensor(0.0420, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0420, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0419, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0419, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56700\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(9.8444, device='cuda:0') tensor(0.0494, device='cuda:0')\n",
      " tensor(0.0494, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0494, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0494, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0494, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56800\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(9.9861, device='cuda:0') tensor(0.0072, device='cuda:0')\n",
      " tensor(0.0071, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0071, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0071, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0071, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 56900\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.0217, device='cuda:0') tensor(0.0421, device='cuda:0')\n",
      " tensor(0.0421, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0421, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0421, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0421, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57000\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(9.8877, device='cuda:0') tensor(0.0191, device='cuda:0')\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0191, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9194 0.9194 0.9194 0.92   0.92  ]\n",
      "epoch: 57100\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(9.8638, device='cuda:0') tensor(0.0166, device='cuda:0')\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0166, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57200\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.1517, device='cuda:0') tensor(0.0263, device='cuda:0')\n",
      " tensor(0.0263, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0263, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0263, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0263, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57300\n",
      "[0.2        0.98       0.98166667 0.98166667 0.98166667 0.98166667]\n",
      "[tensor(10.1656, device='cuda:0') tensor(0.0674, device='cuda:0')\n",
      " tensor(0.0672, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0671, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0670, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0669, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57400\n",
      "[0.2        0.97166667 0.97166667 0.97166667 0.97166667 0.97166667]\n",
      "[tensor(9.8113, device='cuda:0') tensor(0.0812, device='cuda:0')\n",
      " tensor(0.0812, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0813, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0814, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0814, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 57500\n",
      "[0.2        0.98666667 0.98666667 0.98666667 0.98666667 0.98666667]\n",
      "[tensor(9.9706, device='cuda:0') tensor(0.0291, device='cuda:0')\n",
      " tensor(0.0291, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0291, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0291, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0291, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57600\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(9.8868, device='cuda:0') tensor(0.0342, device='cuda:0')\n",
      " tensor(0.0342, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0342, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0342, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0342, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57700\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(9.8927, device='cuda:0') tensor(0.0108, device='cuda:0')\n",
      " tensor(0.0108, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0107, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0107, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0107, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57800\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(9.9425, device='cuda:0') tensor(0.0273, device='cuda:0')\n",
      " tensor(0.0273, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0273, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0273, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0273, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 57900\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.0042, device='cuda:0') tensor(0.0488, device='cuda:0')\n",
      " tensor(0.0482, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0477, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0474, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0472, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58000\n",
      "[0.2   0.985 0.985 0.985 0.985 0.985]\n",
      "[tensor(10.0444, device='cuda:0') tensor(0.0346, device='cuda:0')\n",
      " tensor(0.0345, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0345, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0344, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0344, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.917  0.9175 0.9175 0.9175 0.9175]\n",
      "epoch: 58100\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(9.9567, device='cuda:0') tensor(0.0236, device='cuda:0')\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0236, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58200\n",
      "[0.2        0.97666667 0.97666667 0.97666667 0.97666667 0.97666667]\n",
      "[tensor(10.1551, device='cuda:0') tensor(0.0568, device='cuda:0')\n",
      " tensor(0.0568, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0568, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0568, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0568, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58300\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.0900, device='cuda:0') tensor(0.0290, device='cuda:0')\n",
      " tensor(0.0290, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0290, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0290, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0290, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58400\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.0628, device='cuda:0') tensor(0.0141, device='cuda:0')\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0141, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58500\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1018, device='cuda:0') tensor(0.0120, device='cuda:0')\n",
      " tensor(0.0120, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0120, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0120, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0120, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58600\n",
      "[0.2        0.99333333 0.995      0.995      0.995      0.995     ]\n",
      "[tensor(10.1501, device='cuda:0') tensor(0.0178, device='cuda:0')\n",
      " tensor(0.0177, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0176, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0174, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58700\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(9.9603, device='cuda:0') tensor(0.0202, device='cuda:0')\n",
      " tensor(0.0202, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0202, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0202, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0202, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58800\n",
      "[0.2        0.99666667 0.99666667 0.99666667 0.99666667 0.99666667]\n",
      "[tensor(10.0864, device='cuda:0') tensor(0.0102, device='cuda:0')\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0102, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 58900\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.0778, device='cuda:0') tensor(0.0209, device='cuda:0')\n",
      " tensor(0.0209, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0209, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0209, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0209, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59000\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(9.9224, device='cuda:0') tensor(0.0081, device='cuda:0')\n",
      " tensor(0.0081, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0081, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0081, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0081, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "在mean process之前： (1000, 6)\n",
      "测试集准确率: [0.2    0.9165 0.9165 0.9165 0.9165 0.9165]\n",
      "epoch: 59100\n",
      "[0.2  0.99 0.99 0.99 0.99 0.99]\n",
      "[tensor(10.0116, device='cuda:0') tensor(0.0328, device='cuda:0')\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0328, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59200\n",
      "[0.2        0.99166667 0.99166667 0.99166667 0.99166667 0.99166667]\n",
      "[tensor(10.1718, device='cuda:0') tensor(0.0173, device='cuda:0')\n",
      " tensor(0.0173, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0173, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0173, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0173, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59300\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.2107, device='cuda:0') tensor(0.0173, device='cuda:0')\n",
      " tensor(0.0173, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0172, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0172, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0171, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59400\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.1711, device='cuda:0') tensor(0.0159, device='cuda:0')\n",
      " tensor(0.0159, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0159, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0159, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0159, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59500\n",
      "[0.2        0.99833333 0.99833333 0.99833333 0.99833333 0.99833333]\n",
      "[tensor(10.2543, device='cuda:0') tensor(0.0085, device='cuda:0')\n",
      " tensor(0.0085, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0085, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0085, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0085, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59600\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1974, device='cuda:0') tensor(0.0185, device='cuda:0')\n",
      " tensor(0.0178, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0176, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0175, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0174, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59700\n",
      "[0.2        0.99333333 0.99333333 0.99333333 0.99333333 0.99333333]\n",
      "[tensor(10.1716, device='cuda:0') tensor(0.0193, device='cuda:0')\n",
      " tensor(0.0193, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0192, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0192, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0192, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "epoch: 59800\n",
      "[0.2   0.995 0.995 0.995 0.995 0.995]\n",
      "[tensor(10.1850, device='cuda:0') tensor(0.0165, device='cuda:0')\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0165, device='cuda:0', grad_fn=<DivBackward0>)]\n",
      "epoch: 59900\n",
      "[0.2        0.98833333 0.98833333 0.98833333 0.98833333 0.98833333]\n",
      "[tensor(10.2750, device='cuda:0') tensor(0.0321, device='cuda:0')\n",
      " tensor(0.0321, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0320, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0320, device='cuda:0', grad_fn=<DivBackward0>)\n",
      " tensor(0.0319, device='cuda:0', grad_fn=<DivBackward0>)]\n"
     ]
    }
   ],
   "source": [
    "## omniglot\n",
    "\n",
    "import time\n",
    "device = torch.device('cuda')\n",
    "\n",
    "meta = MetaLearner().to(device)\n",
    "\n",
    "epochs = 60000\n",
    "for step in range(epochs):\n",
    "    start = time.time()\n",
    "    x_spt, y_spt, x_qry, y_qry = next('train')\n",
    "    x_spt, y_spt, x_qry, y_qry = torch.from_numpy(x_spt).to(device),\\\n",
    "                                 torch.from_numpy(y_spt).to(device),\\\n",
    "                                 torch.from_numpy(x_qry).to(device),\\\n",
    "                                 torch.from_numpy(y_qry).to(device)\n",
    "    accs,loss = meta(x_spt, y_spt, x_qry, y_qry)\n",
    "    end = time.time()\n",
    "    if step % 100 == 0:\n",
    "        print(\"epoch:\" ,step)\n",
    "        print(accs)\n",
    "        print(loss)\n",
    "        \n",
    "    if step % 1000 == 0:\n",
    "        accs = []\n",
    "        for _ in range(1000//task_num):\n",
    "            # db_train.next('test')\n",
    "            x_spt, y_spt, x_qry, y_qry = next('test')\n",
    "            x_spt, y_spt, x_qry, y_qry = torch.from_numpy(x_spt).to(device),\\\n",
    "                                         torch.from_numpy(y_spt).to(device),\\\n",
    "                                         torch.from_numpy(x_qry).to(device),\\\n",
    "                                         torch.from_numpy(y_qry).to(device)\n",
    "\n",
    "            \n",
    "            for x_spt_one, y_spt_one, x_qry_one, y_qry_one in zip(x_spt, y_spt, x_qry, y_qry):\n",
    "                test_acc = meta.finetunning(x_spt_one, y_spt_one, x_qry_one, y_qry_one)\n",
    "                accs.append(test_acc)\n",
    "        print('在mean process之前：',np.array(accs).shape)\n",
    "        accs = np.array(accs).mean(axis=0).astype(np.float16)\n",
    "        print('测试集准确率:',accs)\n",
    "                                    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T02:49:39.085739Z",
     "start_time": "2020-03-01T02:49:38.948834Z"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-03-01T03:00:56.266331Z",
     "start_time": "2020-03-01T03:00:56.205955Z"
    }
   },
   "outputs": [],
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "wangkai3.6",
   "language": "python",
   "name": "wangkai3.6"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
